Bug 113937

Summary: GStreamer/cdparanoia gst_pad_query invalid data
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Aaron Bockover <abockover>
Component: GNOMEAssignee: E-mail List <gnome-bugs>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Blocker    
Priority: P5 - None    
Version: Beta 2   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Source to testcase demonstrating bug
Patch against our gstreamer-plugins package, fixes the bug.
Final Patch

Description Aaron Bockover 2005-08-29 17:54:33 UTC
The gstreamer-cdparanoia plugin reports invalid sector data (always 0) on
gst_pad_query() calls for getting disk/track information which is needed to
calculate offsets and track durations for CD playback and ripping within
Banshee. The problem also affects Goobox (not sure if that's even being shipped
though), and has been confirmed on Foresight Linux as well.
Comment 1 Aaron Bockover 2005-08-29 17:56:13 UTC
Created attachment 48052 [details]
Source to testcase demonstrating bug

Just running this testcase should exhibit the bug: total_sectors will be 0,
while n_tracks should be correct: the number of tracks on the audio CD being
tested (/dev/hdc by default). Compile, insert audio CD, wait for it to spin and
settle, and then run the program.
Comment 2 Aaron Bockover 2005-08-29 17:57:17 UTC
Sorry, didn't mean to skip over that.
Comment 3 Aaron Bockover 2005-08-29 18:06:52 UTC
Gekker says this should be a blocker since we absolutely need to be able to play
audio CDs in Banshee.
Comment 4 Hans Petter Jansson 2005-08-29 20:12:36 UTC
Do you have the versions of cdparanoia + gstreamer that do work, and the ones
that do not work, handy?
Comment 5 Hans Petter Jansson 2005-08-30 01:54:35 UTC
Created attachment 48083 [details]
Patch against our gstreamer-plugins package, fixes the bug.
Comment 6 Hans Petter Jansson 2005-08-30 01:55:34 UTC
Here's a patch that fixes the problem with GStreamer's cdparanoia
plugin. The bug is entirely in the plugin, and not caused by any
inconsistency in cdparanoia.

The problem was that the plugin has to be in "track mode" for a support
function, get_first_sector(), to return a non-zero value for sector
count. It will then return the sector count of the passed-in track.

I just made an exception so that if not in "track mode", it returns the
sector count of the entire CD, just as it will return the total number
of tracks if that's what you ask for. I changed the reporting function,
not get_first_sector() itself, because there is too much code depending
on it.

Depending on how we're using the plugin's reporting functions in
Banshee, there may be further bugs related to this. That is,
GST_QUERY_TOTAL with sector_format will return the total length of the
CD if no track has been set, and the total length of the *current track*
if one has been set. I think any bugs should be dealt with on a
case-by-case basis - this one had to be fixed in the plugin, because
otherwise there'd be no way to get the total CD length, but others may
be better fixed in Banshee.

As I understand it, the patch needs review before it can be committed to
build.
Comment 7 Aaron Bockover 2005-08-31 06:16:45 UTC
Here's hpj's second revision, which has solved all of the issues, and makes
goobox work again as well. This is what we're sending upstream.
Comment 8 Aaron Bockover 2005-08-31 06:17:32 UTC
Created attachment 48256 [details]
Final Patch

This is what is getting sent upstream.
Comment 9 Aaron Bockover 2005-08-31 06:18:23 UTC
Meant to set this to FIXED. 
Comment 10 JP Rosevear 2005-08-31 12:06:53 UTC
Why close this before its fixed in the distro?

Submitted.