diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-10-28 10:07:41 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2011-11-02 14:41:16 -0400 |
commit | fc43fc9faa6edc3c8df76cfa51510a98958563e6 (patch) | |
tree | be1a8b73d574c14a4824a6ee7cecca928411018b /libavcodec/gsmdec.c | |
parent | b03761b1309293bbf30edef767503875277b01cf (diff) | |
download | ffmpeg-fc43fc9faa6edc3c8df76cfa51510a98958563e6.tar.gz |
gsmdec: add flush function to reset the decoder state when seeking
Diffstat (limited to 'libavcodec/gsmdec.c')
-rw-r--r-- | libavcodec/gsmdec.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/gsmdec.c b/libavcodec/gsmdec.c index 26340c2792..77c22e5d79 100644 --- a/libavcodec/gsmdec.c +++ b/libavcodec/gsmdec.c @@ -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"), }; |