GNOME Bugzilla – Bug 650785
[flacparse] duration query in DEFAULT format failing with flacparse in pipeline (regression)
Last modified: 2011-06-15 22:43:30 UTC
morituri started failing unexpectedly with a "query failed" message on recent distros (see ticket https://thomas.apestaart.org/morituri/trac/ticket/64 ). After investigating, I figured out that it was flac querying that failed, and that moving away /usr/lib64/gstreamer-0.10/libgstaudioparsers.so was working around the bug. After writing a small C test case, I could check that now there's an additional flacparse element inserted in the pipeline morituri is using. Then I looked a bit at gstreamer debug output, one of the differences between the working/non-working case is: 0:00:00.164206087 6570 0x12387d0 DEBUG flacdec gstflacdec.c:1251:gst_flac_dec_sink_event:<flacdec0> newsegment event in TIME format => framed 0:00:00.164271567 6570 0x12387d0 DEBUG flacdec gstflacdec.c:1523:gst_flac_dec_convert_src:<flacdec0> cannot convert: not set up yet 0:00:00.164291788 6570 0x12387d0 WARN flacdec gstflacdec.c:1264:gst_flac_dec_sink_event:<flacdec0> couldn't convert time => samples and then when trying the query: 0:00:00.165943654 6570 0xed0010 DEBUG flacdec gstflacdec.c:1652:gst_flac_dec_src_query:<flacdec0> duration not known yet
Created attachment 188328 [details] test case I used to reproduce the bug When running this test case with a flac file as an argument, the query for length fails. When I move away libgstaudioparsers.so, the query for length succeeds.
Created attachment 188333 [details] python test case
The test works fine on F-14 (-good 0.10.26) and fails on F15 (-good 0.10.29). This is a clear regression. querying length in PAUSED (before any data flows) should always be possible. In this particular case I need it to configure a proper segment seek. Not sure how this doesn't cause trouble in media players that show the length. Maybe they query after data starts flowing ?
It looks like the rank for flacparse was changed from NONE last year: commit 952b27a140b9758b40ddf512e97fd5c7871663f0 Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> Date: Mon Aug 16 11:04:37 2010 +0200 audioparsers: increase ranks to enable auto-plugging Because we can, and should, have some shakedown testing before having these make it into -good later on ... my bad 0.10.20 package on fedora 14 shows it as having a rank of NONE still; 0.10.20 was released 2010-09-03 but does not contain that August commit.
Thomas, you didn't attach your test case, but a tentative workaround for this bug.
I think the problem is the FORMAT_DEFAULT. Queries in FORMAT_TIME seem to work just fine.
In the case of FLAC, should the DEFAULT format be samples or FLAC frames? Converting to samples is easy and could be added without too much work
> In the case of FLAC, should the DEFAULT format be samples or FLAC frames? > Converting to samples is easy and could be added without too much work Samples.
This should fix it: commit 8823ae251a72bd18fc93322914c70390fc16c6b3 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Mon May 23 11:36:36 2011 +0200 flacparse: Implement conversions between TIME and DEFAULT format Fixes bug #650785.
These two actually make it work: commit 900b2fb63dac15fe1013d9e326a7a5c8d4da1cca Author: Tim-Philipp Müller <tim.muller@collabora.co.uk> Date: Mon May 23 13:25:44 2011 +0100 flacdec: also try upstream first for duration query in DEFAULT format https://bugzilla.gnome.org/show_bug.cgi?id=650785 commit 1183d0c1ab9b567e085e30006b984a578f4a6a88 Author: Tim-Philipp Müller <tim.muller@collabora.co.uk> Date: Mon May 23 13:23:21 2011 +0100 flacparse: make conversion from TIME to DEFAULT format (samples) work Fix copy'n'paste error in the previous commit. The real underlying problem, however, is that flacparse sends a newsegment event without a duration/end-time, which makes flacdec not able to answer the query (before it would just operate pull-based itself and init flacdec->segment accordingly itself).
And another one: commit a53540346a18d27b94f5254ac2582cb844e9bde0 Author: Tim-Philipp Müller <tim.muller@collabora.co.uk> Date: Mon May 23 13:50:46 2011 +0100 flacparse: tell baseparse the duration in samples for better accuracy Tell GstBaseParse the duration in samples instead of time, so that a duration query in DEFAULT format will return the correct number of samples without rounding errors. Baseparse will convert this into time itself when needed. https://bugzilla.gnome.org/show_bug.cgi?id=650785