From a5d71c597df80f39c819afa7adc5840482fe89de Mon Sep 17 00:00:00 2001 From: Jochen Henneberg Date: Sat, 27 Oct 2018 13:28:56 +0200 Subject: [PATCH] flacdec: Reset decoder on set_format() Any call to set_format() could mean that the stream type changed so we reset the decoder and mark got_headers FALSE. --- ext/flac/gstflacdec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c index 15f19e6704..b34baf1190 100644 --- a/ext/flac/gstflacdec.c +++ b/ext/flac/gstflacdec.c @@ -263,6 +263,9 @@ gst_flac_dec_set_format (GstAudioDecoder * dec, GstCaps * caps) gst_adapter_clear (flacdec->adapter); } + FLAC__stream_decoder_reset (flacdec->decoder); + flacdec->got_headers = FALSE; + num = gst_value_array_get_size (headers); for (i = 0; i < num; ++i) { const GValue *header_val;