summaryrefslogtreecommitdiff
path: root/ffplay.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2013-03-24 04:14:59 +0100
committerMarton Balint <cus@passwd.hu>2013-03-30 16:44:19 +0100
commitde81d8da4750c812ad7288e39c7fb410f9e0f0f6 (patch)
tree1b77ee284d75b461d906b9e743833ba8e37eaff5 /ffplay.c
parentb448c0a68d0cc7dfef736267dfdaed0e213c020b (diff)
ffplay: fix early frame dropped pts serial
Fixes early frame drop which was kind of broken since 26c208cf0ff59efd7786528884a64d35fc42e9bf. Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ffplay.c b/ffplay.c
index 7406fa2388..430731530d 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -233,6 +233,7 @@ typedef struct VideoState {
double frame_last_returned_time;
double frame_last_filter_delay;
int64_t frame_last_dropped_pos;
+ int frame_last_dropped_serial;
int video_stream;
AVStream *video_st;
PacketQueue videoq;
@@ -1340,7 +1341,7 @@ retry:
if (is->pictq_size == 0) {
SDL_LockMutex(is->pictq_mutex);
if (is->frame_last_dropped_pts != AV_NOPTS_VALUE && is->frame_last_dropped_pts > is->frame_last_pts) {
- update_video_pts(is, is->frame_last_dropped_pts, is->frame_last_dropped_pos, 0);
+ update_video_pts(is, is->frame_last_dropped_pts, is->frame_last_dropped_pos, is->frame_last_dropped_serial);
is->frame_last_dropped_pts = AV_NOPTS_VALUE;
}
SDL_UnlockMutex(is->pictq_mutex);
@@ -1699,6 +1700,7 @@ static int get_video_frame(VideoState *is, AVFrame *frame, int64_t *pts, AVPacke
clockdiff + ptsdiff - is->frame_last_filter_delay < 0) {
is->frame_last_dropped_pos = pkt->pos;
is->frame_last_dropped_pts = dpts;
+ is->frame_last_dropped_serial = *serial;
is->frame_drops_early++;
av_frame_unref(frame);
ret = 0;