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 796980 - vorbisdec: Always handle in-band header packets once the first non-header packet arrives
vorbisdec: Always handle in-band header packets once the first non-header pac...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
unspecified
Other All
: Normal blocker
: 1.14.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-08-16 16:40 UTC by Sebastian Dröge (slomo)
Modified: 2018-09-21 08:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
vorbisdec: Always handle in-band header packets once the first non-header packet arrives (2.94 KB, patch)
2018-08-16 16:41 UTC, Sebastian Dröge (slomo)
committed Details | Review
vorbisdec: Initialize decoder directly once we have the 3 headers (2.67 KB, patch)
2018-09-20 11:10 UTC, Sebastian Dröge (slomo)
none Details | Review
vorbisdec: Initialize decoder directly once we have the 3 headers (2.67 KB, patch)
2018-09-20 11:11 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Sebastian Dröge (slomo) 2018-08-16 16:40:56 UTC
See commit message.

The same change is probably also needed for other Xiph codecs.
Comment 1 Sebastian Dröge (slomo) 2018-08-16 16:41:01 UTC
Created attachment 373363 [details] [review]
vorbisdec: Always handle in-band header packets once the first non-header packet arrives

And clean up any old pending headers if we receive a new identification
header, or if we receive a new set of headers via caps.

Otherwise it might happen that we receive one or more header but not
all, and then afterwards all headers again, and libvorbis does not like
getting headers passed multiple times and would error out.

It only makes sense to pass the very latest headers to the decoder at
the time we can actually make use of them.
Comment 2 Tim-Philipp Müller 2018-08-23 20:45:46 UTC
I wonder if this doesn't indicate that upstream is not handling something correctly. Shouldn't upstream detect changes and set new caps if things change as well?

Perhaps this is related to bug #788246 ? (Patch was committed though, but might not be complete.)
Comment 3 Sebastian Dröge (slomo) 2018-08-27 06:15:53 UTC
This was observed with rtpgstpay/depay. It might be that upstream is doing something wrong here but the code here seems to be more robust to any such misbehaviours.
Comment 4 Sebastian Dröge (slomo) 2018-08-28 12:55:47 UTC
And e.g. in the case of rtpgstpay, header packets could also get dropped.

So what to do here? :)
Comment 5 Tim-Philipp Müller 2018-08-28 13:06:40 UTC
I have no objections to this, was just wondering :)
Comment 6 Sebastian Dröge (slomo) 2018-08-28 13:14:48 UTC
Ok, then need to do the same for all the other Xiph codecs :)
Comment 7 Sebastian Dröge (slomo) 2018-08-28 14:47:25 UTC
Attachment 373363 [details] pushed as 0619168 - vorbisdec: Always handle in-band header packets once the first non-header packet arrives
Comment 8 Sebastian Dröge (slomo) 2018-08-28 14:47:39 UTC
The other Xiph codecs work differently or simply don't allow header changes
Comment 9 Tim-Philipp Müller 2018-09-08 17:47:08 UTC
Should this be picked into 1.14 as well or is it risky/intrusive?
Comment 10 Tim-Philipp Müller 2018-09-08 18:37:07 UTC
Picked into 1.14
Comment 11 Edward Hervey 2018-09-19 15:42:58 UTC
This commit breaks discovering files with initial gaps.

* The 3 header buffers are received by vorbisdec (it could configure itself but doesn't)
* A GAP event is received
** audiodecoder tries doing a default negotiation and fails (since vorbisdec didn't provide the information yet).
Comment 12 Sebastian Dröge (slomo) 2018-09-20 11:10:20 UTC
Created attachment 373710 [details] [review]
vorbisdec: Initialize decoder directly once we have the 3 headers

... instead of waiting for the first non-header buffer.

Also drop non-identification headers arriving after initialization or
before the identification header. We don't do anything with them and
they would just accumulate.
Comment 13 Sebastian Dröge (slomo) 2018-09-20 11:11:47 UTC
Created attachment 373711 [details] [review]
vorbisdec: Initialize decoder directly once we have the 3 headers

... instead of waiting for the first non-header buffer.

Also drop non-identification headers arriving after initialization or
before the identification header. We don't do anything with them and
they would just accumulate.
Comment 14 Sebastian Dröge (slomo) 2018-09-21 08:49:18 UTC
Attachment 373711 [details] pushed as 55ec47f - vorbisdec: Initialize decoder directly once we have the 3 headers