From db8605a3e148eafb530d28f38cbba28fa914dc0b Mon Sep 17 00:00:00 2001 From: wang-bin Date: Tue, 27 May 2014 18:35:29 +0800 Subject: [PATCH] do not exit avthread too early if video stream has only 1 frame we should keep it displaying --- src/AVDemuxThread.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/AVDemuxThread.cpp b/src/AVDemuxThread.cpp index 49647880..6dd3fced 100644 --- a/src/AVDemuxThread.cpp +++ b/src/AVDemuxThread.cpp @@ -301,10 +301,7 @@ void AVDemuxThread::run() video_thread->setDemuxEnded(true); all_end &= !video_thread->isRunning(); } - if (aqueue) - aqueue->put(Packet()); - if (vqueue) - vqueue->put(Packet()); + // flush packet will send when out the loop. now it's still playing. too early to flush, e.g. video stream has 1 frame and flush now if (!all_end) { cond.wait(&buffer_mutex); }