[FFmpeg-cvslog] ffplay: only do early frame drop if video queue is not empty

Marton Balint git at videolan.org
Sat Apr 20 22:09:38 CEST 2013


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Tue Apr 16 20:34:28 2013 +0200| [b8facbeecb66a4bce59dbf76a97518283609eb55] | committer: Marton Balint

ffplay: only do early frame drop if video queue is not empty

Fixes ticket #2446.

Signed-off-by: Marton Balint <cus at passwd.hu>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b8facbeecb66a4bce59dbf76a97518283609eb55
---

 ffplay.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ffplay.c b/ffplay.c
index b140edb..e2014be 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -1694,7 +1694,8 @@ static int get_video_frame(VideoState *is, AVFrame *frame, AVPacket *pkt, int *s
                 double ptsdiff = dpts - is->frame_last_pts;
                 if (!isnan(clockdiff) && fabs(clockdiff) < AV_NOSYNC_THRESHOLD &&
                     !isnan(ptsdiff) && ptsdiff > 0 && ptsdiff < AV_NOSYNC_THRESHOLD &&
-                    clockdiff + ptsdiff - is->frame_last_filter_delay < 0) {
+                    clockdiff + ptsdiff - is->frame_last_filter_delay < 0 &&
+                    is->videoq.nb_packets) {
                     is->frame_last_dropped_pos = pkt->pos;
                     is->frame_last_dropped_pts = dpts;
                     is->frame_last_dropped_serial = *serial;



More information about the ffmpeg-cvslog mailing list