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 336824 - [mad] returns incorrect duration to queries in BYTES format
[mad] returns incorrect duration to queries in BYTES format
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-ugly
git master
Other All
: Normal normal
: 0.10.4
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-04-01 12:40 UTC by Lutz Mueller
Modified: 2006-04-21 19:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix problem (7.28 KB, patch)
2006-04-01 12:42 UTC, Lutz Mueller
none Details | Review
Patch to fix problem (8.01 KB, patch)
2006-04-05 06:32 UTC, Lutz Mueller
rejected Details | Review

Description Lutz Mueller 2006-04-01 12:40:53 UTC
Please describe the problem:
The gstmad plugin returns incorrect estimations for the position/duration if
queried for the format bytes.

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Lutz Mueller 2006-04-01 12:42:54 UTC
Created attachment 62532 [details] [review]
Patch to fix problem

This patch makes the mad plugin calculate the position/duration in bytes based on the past average compression rate.
Comment 2 Tim-Philipp Müller 2006-04-03 09:31:42 UTC
IMHO mad should just return FALSE to queries in format BYTE. It's a completely useless query on decoder source pads, I don't see why we need that for raw audio format streams.

Is there a particular use case you have in mind for this?

(Also, in the patch, mad->in and mad->out should be reset to 0 in the state change function).

Comment 3 Lutz Mueller 2006-04-05 06:32:22 UTC
Created attachment 62777 [details] [review]
Patch to fix problem

This patch resets mad->in and mad->out to 0 when changing state (as you suggested). 

I wouldn't call queries for the size in bytes useless - you may want to know the size of the output file in case of conversion between formats.
Comment 4 Tim-Philipp Müller 2006-04-21 19:40:36 UTC
Should be fixed now:

  2006-04-21  Tim-Philipp Müller  <tim at centricular dot net>

        * ext/mad/gstmad.c: (gst_mad_src_query):
          Fix duration query in BYTES format (#336824).


Not using your patch as it breaks duration quering in TIME format for raw mp3 streams. Also, I think the result of the BYTES query should directly correlate with the result of a TIME/DEFAULT query and not be based on a different average than those two.