Browse code

libgsm: Reset the MS mode of GSM in the flush function

The mode is set in libgsm_decode_init, but the decoder
object is simply destroyed and recreated in the flush
function - therefore the mode has to be set again.

This fixes playback using the libgsm_ms decoder in avplay.

Signed-off-by: Martin Storsjö <martin@martin.st>

Martin Storsjö authored on 2011/12/15 05:32:29
Showing 1 changed files
... ...
@@ -212,9 +212,12 @@ static int libgsm_decode_frame(AVCodecContext *avctx, void *data,
212 212
 
213 213
 static void libgsm_flush(AVCodecContext *avctx) {
214 214
     LibGSMDecodeContext *s = avctx->priv_data;
215
+    int one = 1;
215 216
 
216 217
     gsm_destroy(s->state);
217 218
     s->state = gsm_create();
219
+    if (avctx->codec_id == CODEC_ID_GSM_MS)
220
+        gsm_option(s->state, GSM_OPT_WAV49, &one);
218 221
 }
219 222
 
220 223
 AVCodec ff_libgsm_decoder = {