container_ffmpeg: flush streams immediately after seek

Origin commit data
------------------
Branch: master
Commit: 1f0340cf19
Author: martii <m4rtii@gmx.de>
Date: 2013-07-20 (Sat, 20 Jul 2013)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
martii
2013-07-20 09:08:31 +02:00
parent 4abf203acb
commit 953288588e

View File

@@ -426,6 +426,12 @@ static void FFMPEGThread(Context_t *context) {
restart_audio_resampling = 1; restart_audio_resampling = 1;
latestPts = 0; latestPts = 0;
seek_target_flag = 0; seek_target_flag = 0;
// flush streams
unsigned int i;
for (i = 0; i < avContext->nb_streams; i++)
if (avContext->streams[i]->codec && avContext->streams[i]->codec->codec)
avcodec_flush_buffers(avContext->streams[i]->codec);
} }
if (context->playback->BackWard) { if (context->playback->BackWard) {
@@ -529,12 +535,6 @@ static void FFMPEGThread(Context_t *context) {
if (restart_audio_resampling) { if (restart_audio_resampling) {
restart_audio_resampling = 0; restart_audio_resampling = 0;
// flush streams
unsigned int i;
for (i = 0; i < avContext->nb_streams; i++)
if (avContext->streams[i]->codec && avContext->streams[i]->codec->codec)
avcodec_flush_buffers(avContext->streams[i]->codec);
#ifdef USE_LIBSWRESAMPLE #ifdef USE_LIBSWRESAMPLE
if (swr) { if (swr) {
swr_free(&swr); swr_free(&swr);