ffplay: only do early frame drop if video queue is not empty
authorMarton Balint <cus@passwd.hu>
Tue, 16 Apr 2013 18:34:28 +0000 (20:34 +0200)
committerMarton Balint <cus@passwd.hu>
Sat, 20 Apr 2013 16:32:09 +0000 (18:32 +0200)
Fixes ticket #2446.

Signed-off-by: Marton Balint <cus@passwd.hu>
ffplay.c

index b140edb..e2014be 100644 (file)
--- 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;