mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 12:41:05 +00:00
vorbisdec: Reset decoder in more situations
This is a followup commit to b95725c37e
* Resetting the decoder should only happen when we get a new initialization
header (0x01) and not on the other headers
* The initialized variable only gets set to TRUE once all headers have
been parsed. Also check if the vorbis_info struct has been properly resetted
also. Failure to do that would cause vorbisdec to error if it got
two initialization header in a row (the first would configure the underlying
library and the second one would error out because it's already initialized)
https://bugzilla.gnome.org/show_bug.cgi?id=779515
This commit is contained in:
parent
6eef6bd1f5
commit
e575be6dc6
1 changed files with 5 additions and 1 deletions
|
@ -582,7 +582,11 @@ vorbis_dec_handle_frame (GstAudioDecoder * dec, GstBuffer * buffer)
|
||||||
|
|
||||||
/* switch depending on packet type */
|
/* switch depending on packet type */
|
||||||
if ((gst_ogg_packet_data (packet))[0] & 1) {
|
if ((gst_ogg_packet_data (packet))[0] & 1) {
|
||||||
if (vd->initialized) {
|
/* If we get a new initialization packet, reset the decoder.
|
||||||
|
* The vorbis_info struct should have a rate of 0 if it hasn't been
|
||||||
|
* initialized yet. */
|
||||||
|
if ((vd->initialized || (vd->vi.rate != 0)) &&
|
||||||
|
(gst_ogg_packet_data (packet))[0] == 0x01) {
|
||||||
GST_INFO_OBJECT (vd, "already initialized, re-init");
|
GST_INFO_OBJECT (vd, "already initialized, re-init");
|
||||||
vorbis_dec_reset (dec);
|
vorbis_dec_reset (dec);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue