After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 313209 - [cdparanoia] wrong track info
[cdparanoia] wrong track info
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins
0.8.x
Other All
: Normal normal
: 0.8.12
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 315144 (view as bug list)
Depends on:
Blocks: 312657
 
 
Reported: 2005-08-11 08:53 UTC by Paolo Bacchilega
Modified: 2005-10-06 15:05 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
simple patch (591 bytes, patch)
2005-09-05 10:46 UTC, Felix Riemann
committed Details | Review

Description Paolo Bacchilega 2005-08-11 08:53:09 UTC
Please describe the problem:
the cdparanoia plugin doesn't return the right track info from a cd, it always
return 0 track length, this happens with version 0.8.10, works good with 0.8.8 


Steps to reproduce:
1. insert a cd in the cd drive
2. execute gst-plugins/examples/seeking/cdparanoia
3. look at the track info


Actual results:
track length is always 0

Expected results:
the right track length to be printed out.

Does this happen every time?
yes

Other information:
Comment 1 Felix Riemann 2005-09-02 18:43:18 UTC
I think I found whats causing it.
During the inclusion of the track_mode-stuff there was also the function
get_first_sector(). This function replaced some former direct calls to cdparanoia.
But it has an (in my eyes useless) check for track_mode returning 0 if not in
track_mode. See:
static guint
get_first_sector (CDParanoia * src, guint track)
  {
  if (!src->track_mode)
    return 0;
  else if (track == src->d->tracks)
    return src->last_sector + 1;
  else
    return cdda_track_firstsector (src->d, track + 1);
}

This unfortunately locks out the call to cddb_track_firstsector, which works
even when not in track_mode. I think the function could be as simple as:
static guint
get_first_sector (CDParanoia * src, guint track)
{
  if (track == src->d->tracks)
    return src->last_sector + 1;
  else
    return cdda_track_firstsector (src->d, track + 1);
}
or even shorter:
static guint
get_first_sector (CDParanoia * src, guint track)
{
  return ((track == src->d->tracks) ? src->last_sector + 1 :
cdda_track_firstsector (src->d, track + 1));  

}

From what I can see this doesn't interfere with Totem or gnome-cd
Comment 2 Götz Waschk 2005-09-05 06:38:38 UTC
Can you please attach a patch?
Comment 3 Felix Riemann 2005-09-05 10:46:03 UTC
Created attachment 51823 [details] [review]
simple patch

This a patch doing what I described earlier. It's done with gst-plugins-0.8.10
but it should apply to 0.8.11 (==CVS), which I couldn't test yet, too.
Comment 4 Felix Riemann 2005-09-05 12:23:04 UTC
Ok, I got around to test it with gstreamer/gst-plugins-0.8.11 now:
Patch applies and works nicely here.
Comment 5 Luca Ognibene 2005-09-21 20:22:03 UTC
I think there's a similar patch at bug #315144. Are the patch fixing the same
bug ? (i've not looked closely at them yet). thanks!
Comment 6 Andy Wingo 2005-10-06 14:20:54 UTC
*** Bug 315144 has been marked as a duplicate of this bug. ***
Comment 7 Andy Wingo 2005-10-06 14:25:20 UTC
Patch committed, thanks.