diff options
author | wm4 <wm4@nowhere> | 2014-08-23 12:43:09 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-08-23 12:48:45 +0200 |
commit | 1cedb323ad0819690306b78d206e383d986d830e (patch) | |
tree | 9a7b53b1a177648ce5c1225caddecf6962c5c01b /video | |
parent | 39b42814e0352535b697633b50d009025fd39303 (diff) | |
download | mpv-1cedb323ad0819690306b78d206e383d986d830e.tar.bz2 mpv-1cedb323ad0819690306b78d206e383d986d830e.tar.xz |
video: avoid unnecessary frame dropping
If duration<0, it means the duration is unknown. Disable framedropping,
because end_time makes no sense in this case.
Also, strictly never drop the first frame.
This fixes weird behavior with the cover-art case (for the 100th time).
Diffstat (limited to 'video')
-rw-r--r-- | video/out/vo.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/video/out/vo.c b/video/out/vo.c index 3248023cd5..5b63f3cfc2 100644 --- a/video/out/vo.c +++ b/video/out/vo.c @@ -128,6 +128,7 @@ struct vo_internal { bool hasframe; + bool hasframe_rendered; bool request_redraw; bool paused; @@ -384,6 +385,7 @@ static void forget_frames(struct vo *vo) { struct vo_internal *in = vo->in; in->hasframe = false; + in->hasframe_rendered = false; in->drop_count = 0; mp_image_unrefp(&in->frame_queued); mp_image_unrefp(&in->dropped_image); @@ -560,7 +562,8 @@ static bool render_frame(struct vo *vo) int64_t next_vsync = prev_sync(vo, mp_time_us()) + in->vsync_interval; int64_t end_time = pts + duration; - in->dropped_frame = end_time < next_vsync; + in->dropped_frame = duration >= 0 && end_time < next_vsync; + in->dropped_frame &= in->hasframe_rendered; in->dropped_frame &= !!(vo->global->opts->frame_dropping & 1); in->dropped_frame &= !(vo->driver->caps & VO_CAP_FRAMEDROP) && !vo->driver->untimed && !vo->driver->encode; @@ -572,6 +575,7 @@ static bool render_frame(struct vo *vo) in->drop_count += 1; in->dropped_image = img; } else { + in->hasframe_rendered = true; pthread_mutex_unlock(&in->lock); MP_STATS(vo, "start video"); |