aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libgsm.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2011-12-14 22:32:29 +0200
committerMartin Storsjö <martin@martin.st>2011-12-15 09:08:40 +0200
commit1b35af3225392a5328f6534c53e96a56cd5eb305 (patch)
treec76973b6eabb5cbddd76c5347e8de0a3f52beb09 /libavcodec/libgsm.c
parent8637af8d2499e72ad6662627dae9f245e3e961df (diff)
downloadffmpeg-1b35af3225392a5328f6534c53e96a56cd5eb305.tar.gz
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>
Diffstat (limited to 'libavcodec/libgsm.c')
-rw-r--r--libavcodec/libgsm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/libgsm.c b/libavcodec/libgsm.c
index 7623d35e81..16d9972f2c 100644
--- a/libavcodec/libgsm.c
+++ b/libavcodec/libgsm.c
@@ -212,9 +212,12 @@ static int libgsm_decode_frame(AVCodecContext *avctx, void *data,
static void libgsm_flush(AVCodecContext *avctx) {
LibGSMDecodeContext *s = avctx->priv_data;
+ int one = 1;
gsm_destroy(s->state);
s->state = gsm_create();
+ if (avctx->codec_id == CODEC_ID_GSM_MS)
+ gsm_option(s->state, GSM_OPT_WAV49, &one);
}
AVCodec ff_libgsm_decoder = {