From 2ed870c8546ce4654f956beea60546260d98a85c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 15 Sep 2011 21:41:25 +0200 Subject: decoder/ffmpeg: flush the codec after seeking Let the codec start with fresh buffers. This should fix the remaining seeking issues. --- src/decoder/ffmpeg_decoder_plugin.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/decoder/ffmpeg_decoder_plugin.c b/src/decoder/ffmpeg_decoder_plugin.c index 77c1a122f..ba47b2c2c 100644 --- a/src/decoder/ffmpeg_decoder_plugin.c +++ b/src/decoder/ffmpeg_decoder_plugin.c @@ -459,8 +459,10 @@ ffmpeg_decode(struct decoder *decoder, struct input_stream *input) if (av_seek_frame(format_context, audio_stream, where, AV_TIME_BASE) < 0) decoder_seek_error(decoder); - else + else { + avcodec_flush_buffers(codec_context); decoder_command_finished(decoder); + } } } while (cmd != DECODE_COMMAND_STOP); -- cgit v1.2.3