GNOME Bugzilla – Bug 796980
vorbisdec: Always handle in-band header packets once the first non-header packet arrives
Last modified: 2018-09-21 08:49:22 UTC
See commit message. The same change is probably also needed for other Xiph codecs.
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.
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.)
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.
And e.g. in the case of rtpgstpay, header packets could also get dropped. So what to do here? :)
I have no objections to this, was just wondering :)
Ok, then need to do the same for all the other Xiph codecs :)
Attachment 373363 [details] pushed as 0619168 - vorbisdec: Always handle in-band header packets once the first non-header packet arrives
The other Xiph codecs work differently or simply don't allow header changes
Should this be picked into 1.14 as well or is it risky/intrusive?
Picked into 1.14
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).
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.
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.
Attachment 373711 [details] pushed as 55ec47f - vorbisdec: Initialize decoder directly once we have the 3 headers