aboutsummaryrefslogtreecommitdiffstats
path: root/ffplay.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2012-11-03 00:30:20 +0100
committerMarton Balint <cus@passwd.hu>2012-11-28 21:39:50 +0100
commitf7eb50f3c0704a0d6e87dd218fc948b82a5e6329 (patch)
tree75d706fe88ba5e2b6f81197aa814d16a6dbb5541 /ffplay.c
parent2efd01a32f0cc7849794f7a866fddf3991b5f5ce (diff)
downloadffmpeg-f7eb50f3c0704a0d6e87dd218fc948b82a5e6329.tar.gz
ffplay: increase maximum frame duration to 1 hour for streams without TS discontinuity
Partially fixes ticket #1707. A-V sync still needs some work after seeking... Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ffplay.c b/ffplay.c
index a3bda0eea9..842939a777 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -234,6 +234,7 @@ typedef struct VideoState {
double video_current_pts; // current displayed pts (different from video_clock if frame fifos are used)
double video_current_pts_drift; // video_current_pts - time (av_gettime) at which we updated video_current_pts - used to have running video pts
int64_t video_current_pos; // current displayed file pos
+ double max_frame_duration; // maximum duration of a frame - above this, we consider the jump a timestamp discontinuity
VideoPicture pictq[VIDEO_PICTURE_QUEUE_SIZE];
int pictq_size, pictq_rindex, pictq_windex;
SDL_mutex *pictq_mutex;
@@ -1318,7 +1319,7 @@ retry:
/* compute nominal last_duration */
last_duration = vp->pts - is->frame_last_pts;
- if (last_duration > 0 && last_duration < 10.0) {
+ if (last_duration > 0 && last_duration < is->max_frame_duration) {
/* if duration of the last frame was sane, update last_duration in video state */
is->frame_last_duration = last_duration;
}
@@ -2557,6 +2558,8 @@ static int read_thread(void *arg)
if (seek_by_bytes < 0)
seek_by_bytes = !!(ic->iformat->flags & AVFMT_TS_DISCONT);
+ is->max_frame_duration = (ic->iformat->flags & AVFMT_TS_DISCONT) ? 10.0 : 3600.0;
+
/* if seeking requested, we execute it */
if (start_time != AV_NOPTS_VALUE) {
int64_t timestamp;