summaryrefslogtreecommitdiffstats
path: root/player/video.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-16 13:45:43 +0100
committerwm4 <wm4@nowhere>2015-01-16 13:57:33 +0100
commit918b06c42cda98dd8d6f407956620826bd6be80a (patch)
treed6ff6e958aae1f2a60a1c3b1b82d46bd0aee7f19 /player/video.c
parent42fa954849da670f56043766d1a17a9f36ceb94f (diff)
downloadmpv-918b06c42cda98dd8d6f407956620826bd6be80a.tar.bz2
mpv-918b06c42cda98dd8d6f407956620826bd6be80a.tar.xz
player: respect --untimed on last frame
The last video frame is another case that has a separate code path, although it's pretty similar to the one in commit 73e5aa87. Fix this in a different way, which also takes care of the last frame case, although without context the code becomes slightly more tricky. As further cleanup, move the decision about framedropping itself to the same place, so the check in vo.c becomes much simpler. The check for the vo->driver->encode flag, which is remvoed completely, was redundant too. Fixes #1480.
Diffstat (limited to 'player/video.c')
-rw-r--r--player/video.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/player/video.c b/player/video.c
index 23e3747219..05c5fd42e1 100644
--- a/player/video.c
+++ b/player/video.c
@@ -786,7 +786,7 @@ void write_video(struct MPContext *mpctx, double endpts)
struct mp_image_params p = mpctx->next_frame[0]->params;
if (!vo->params || !mp_image_params_equal(&p, vo->params)) {
// Changing config deletes the current frame; wait until it's finished.
- if (vo_still_displaying(vo) && !(opts->untimed || vo->driver->untimed))
+ if (vo_still_displaying(vo))
return;
const struct vo_driver *info = mpctx->video_out->driver;
@@ -824,6 +824,8 @@ void write_video(struct MPContext *mpctx, double endpts)
diff = vpts1 - vpts0;
if (diff < 0 && mpctx->d_video->fps > 0)
diff = 1.0 / mpctx->d_video->fps; // fallback to demuxer-reported fps
+ if (opts->untimed || vo->driver->untimed || !(opts->frame_dropping & 1))
+ diff = -1; // disable frame dropping and aspects of frame timing
if (diff >= 0) {
// expected A/V sync correction is ignored
diff /= opts->playback_speed;