summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2013-04-16 20:34:28 +0200
committerMarton Balint <cus@passwd.hu>2013-04-20 18:32:09 +0200
commitb8facbeecb66a4bce59dbf76a97518283609eb55 (patch)
tree367d5ce6b4faa4f9bf0fe4b14d63be273890a860
parentd148339d19c6c77b06beab28f603b5c8b2b84c6e (diff)
downloadffmpeg-streaming-b8facbeecb66a4bce59dbf76a97518283609eb55.zip
ffmpeg-streaming-b8facbeecb66a4bce59dbf76a97518283609eb55.tar.gz
ffplay: only do early frame drop if video queue is not empty
Fixes ticket #2446. Signed-off-by: Marton Balint <cus@passwd.hu>
-rw-r--r--ffplay.c3
1 files changed, 2 insertions, 1 deletions
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;
OpenPOWER on IntegriCloud