diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2011-08-20 18:14:44 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2011-08-21 12:54:34 +0200 |
commit | 4ba8c521b1119c8235f8ad83c4edecb0bf9feb10 (patch) | |
tree | cc17500b9310554e2290132b28bdf65e965fac44 /libavcodec/wavpack.c | |
parent | eaf2d37acc332809efe9313d72d3f14117427ef9 (diff) | |
download | ffmpeg-4ba8c521b1119c8235f8ad83c4edecb0bf9feb10.tar.gz |
WavPack decoder: implement flush function
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/wavpack.c')
-rw-r--r-- | libavcodec/wavpack.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index bd1e435d86..62f68804b3 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -1189,6 +1189,15 @@ static int wavpack_decode_frame(AVCodecContext *avctx, return s->samples_left > 0 ? 0 : avpkt->size; } +static void wavpack_decode_flush(AVCodecContext *avctx) +{ + WavpackContext *s = avctx->priv_data; + int i; + + for (i = 0; i < s->fdec_num; i++) + s->fdec[i]->samples_left = 0; +} + AVCodec ff_wavpack_decoder = { .name = "wavpack", .type = AVMEDIA_TYPE_AUDIO, @@ -1197,6 +1206,7 @@ AVCodec ff_wavpack_decoder = { .init = wavpack_decode_init, .close = wavpack_decode_end, .decode = wavpack_decode_frame, + .flush = wavpack_decode_flush, .capabilities = CODEC_CAP_SUBFRAMES, .long_name = NULL_IF_CONFIG_SMALL("WavPack"), }; |