GNOME Bugzilla – Bug 334192
[mad] wrong duration of (vbr) mp3 files with a visualization pipeline
Last modified: 2006-07-11 07:30:27 UTC
i have written a visualisation pipeline: filesrc - decodebin - tee - { audio_part, visualization part } i put in the pipeline a filesrc and a decodebin. I pause it. If an audio pad is found, I add in the pipeline a tee, and on this tee, the audio part and the visualization part. Once the paused state is finished, i try to get the duration of the stream. The duration I get is never the correct one. i've tried several ogg files (with vorbis content) and the duration seems good. the test program is attached below
Created attachment 61075 [details] test program test program that displays the duration of an audio file with a visualization pipeline
This is probably a problem with VBR mp3s. For those, we don't get the duration right at the beginning of the stream. The duration will get better the more of the stream has been played back. The only way to know the exact location is to scan the entire file in advance and we don't do that for performance reasons at the moment. A possibility would be to add an mpeg audio parser element that scans the file in advance if pull-mode is supported (and just does passthrough otherwise). Then apps could change the rank of the element so it gets plugged before mad in decodebin/playbin. Another possibility would be to add index support to mad and make it scan the file if an index is set. For now the imprecise duration is intended behaviour though, a trade-off basically.
*** Bug 346975 has been marked as a duplicate of this bug. ***