libcdio-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libcdio-help] cd-info doesn't get cddb info for discs with data


From: Rocky Bernstein
Subject: Re: [Libcdio-help] cd-info doesn't get cddb info for discs with data
Date: Mon, 12 Sep 2011 21:48:05 -0400



On Sun, Sep 11, 2011 at 3:52 PM, Stephen Kell <address@hidden> wrote:
Here's a *very* belated follow-up... apologies and more.

> > I'd say if there are *any* audio tracks, it's worth doing a CDDB
> > lookup. Sometimes the order is reversed, e.g. game CDs that have a
> > red-book audio soundtrack after the track with the game data.
> > Sometimes there are even multiple data tracks (e.g. one for Mac,
> > one for Windows).

The following trivial patch gives the CDDB behaviour I think best.
If there are any audio tracks, it should do a lookup.  (The line
numbers might need a bit of fuzz, or perhaps just apply manually.)

You are right. This patch was totally borked. So I applied by hand. In the future, please submit a patch at https://savannah.gnu.org/patch/?group=libcdio using current git sources. 
 

diff --git a/src/cd-info.c b/src/cd-info.c
index f2a903e..13892d4 100644
--- a/src/cd-info.c
+++ b/src/cd-info.c
@@ -1188,8 +1188,9 @@ main(int argc, char *argv[])
    report(stdout, STRONG "CD Analysis Report\n" NORMAL);

    /* try to find out what sort of CD we have */
-    if (0 == num_data) {
-      /* no data track, may be a "real" audio CD or hidden track CD */
+    if (num_audio > 0) {
+      /* may be a "real" audio CD or hidden track CD */

      msf_t msf;
      cdio_get_track_msf(p_cdio, i_first_track, &msf);
@@ -1209,7 +1210,8 @@ main(int argc, char *argv[])
      print_analysis(ms_offset, cdio_iso_analysis, fs, first_data, num_audio,
                    i_tracks, i_first_track,
                    cdio_get_track_format(p_cdio, 1), p_cdio);
-    } else {
+    }
+    if (num_data > 0) {
      /* we have data track(s) */
      int j;

About the issue of test-cases for unusual CDs: I briefly started work
on a script that would rip a whole CD and then effectively delete the
content while preserving the structure. But it turns out that the first
part of this is very tricky, never mind the second. Just getting the
data out of CD-EXTRA discs is hard (extricate works). So I need to
solve the block number issues mentioned on the list last year
<http://comments.gmane.org/gmane.comp.audio.libcdio.devel/547>.

I might get time to work on this some time... I have no idea when. (I'm
being more cautious after saying "a couple of days" several months
ago. :-)

Cheers,
Stephen.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]