Browse Source

gsmdec: add flush function to reset the decoder state when seeking

tags/n0.9
Justin Ruggles 14 years ago
parent
commit
fc43fc9faa
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      libavcodec/gsmdec.c

+ 8
- 0
libavcodec/gsmdec.c View File

@@ -87,6 +87,12 @@ static int gsm_decode_frame(AVCodecContext *avctx, void *data,
return avctx->block_align;
}

static void gsm_flush(AVCodecContext *avctx)
{
GSMContext *s = avctx->priv_data;
memset(s, 0, sizeof(*s));
}

AVCodec ff_gsm_decoder = {
.name = "gsm",
.type = AVMEDIA_TYPE_AUDIO,
@@ -94,6 +100,7 @@ AVCodec ff_gsm_decoder = {
.priv_data_size = sizeof(GSMContext),
.init = gsm_init,
.decode = gsm_decode_frame,
.flush = gsm_flush,
.long_name = NULL_IF_CONFIG_SMALL("GSM"),
};

@@ -104,5 +111,6 @@ AVCodec ff_gsm_ms_decoder = {
.priv_data_size = sizeof(GSMContext),
.init = gsm_init,
.decode = gsm_decode_frame,
.flush = gsm_flush,
.long_name = NULL_IF_CONFIG_SMALL("GSM Microsoft variant"),
};

Loading…
Cancel
Save