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 650785 - [flacparse] duration query in DEFAULT format failing with flacparse in pipeline (regression)
[flacparse] duration query in DEFAULT format failing with flacparse in pipeli...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
0.10.29
Other Linux
: Normal blocker
: 0.10.31
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-05-22 09:43 UTC by Christophe Fergeau
Modified: 2011-06-15 22:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test case I used to reproduce the bug (1.96 KB, text/plain)
2011-05-22 09:45 UTC, Christophe Fergeau
Details
python test case (206 bytes, application/octet-stream)
2011-05-22 13:01 UTC, Thomas Vander Stichele
Details

Description Christophe Fergeau 2011-05-22 09:43:31 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
Comment 1 Christophe Fergeau 2011-05-22 09:45:46 UTC
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.
Comment 2 Thomas Vander Stichele 2011-05-22 13:01:04 UTC
Created attachment 188333 [details]
python test case
Comment 3 Thomas Vander Stichele 2011-05-22 13:04:08 UTC
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 ?
Comment 4 Thomas Vander Stichele 2011-05-22 13:47:02 UTC
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.
Comment 5 Christophe Fergeau 2011-05-22 13:57:26 UTC
Thomas, you didn't attach your test case, but a tentative workaround for this bug.
Comment 6 Tim-Philipp Müller 2011-05-22 22:12:43 UTC
I think the problem is the FORMAT_DEFAULT. Queries in FORMAT_TIME seem to work just fine.
Comment 7 Sebastian Dröge (slomo) 2011-05-23 08:54:26 UTC
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
Comment 8 Tim-Philipp Müller 2011-05-23 09:04:18 UTC
> 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.
Comment 9 Sebastian Dröge (slomo) 2011-05-23 09:43:28 UTC
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.
Comment 10 Tim-Philipp Müller 2011-05-23 12:33:24 UTC
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).
Comment 11 Tim-Philipp Müller 2011-05-23 12:54:37 UTC
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