summaryrefslogtreecommitdiff
path: root/libavcodec/g726.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-10-27 21:33:18 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-11-01 21:23:04 -0400
commitda249637251869fb93bdf58de44e50b74df2ec35 (patch)
treeaf824ea2f9a70a6efd260722299e7f9505e01aac /libavcodec/g726.c
parent97f5dd1d84d2352450093a696869433b6c85db9a (diff)
g726dec: add flush() function to reset state when seeking
Diffstat (limited to 'libavcodec/g726.c')
-rw-r--r--libavcodec/g726.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/g726.c b/libavcodec/g726.c
index f14958a55d..37b0adf3b4 100644
--- a/libavcodec/g726.c
+++ b/libavcodec/g726.c
@@ -460,6 +460,12 @@ static int g726_decode_frame(AVCodecContext *avctx,
return buf_size;
}
+static void g726_decode_flush(AVCodecContext *avctx)
+{
+ G726Context *c = avctx->priv_data;
+ g726_reset(c);
+}
+
AVCodec ff_adpcm_g726_decoder = {
.name = "g726",
.type = AVMEDIA_TYPE_AUDIO,
@@ -467,6 +473,7 @@ AVCodec ff_adpcm_g726_decoder = {
.priv_data_size = sizeof(G726Context),
.init = g726_decode_init,
.decode = g726_decode_frame,
+ .flush = g726_decode_flush,
.long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"),
};
#endif