summaryrefslogtreecommitdiffstats
path: root/mpvcore/player/mp_core.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-12-10 19:33:11 +0100
committerwm4 <wm4@nowhere>2013-12-10 20:07:39 +0100
commit227d087db601a02d4d71ea914f61e4d69fd34e6c (patch)
treeccedfff3c3123b7764a6c24a9e8b124bcf0dc403 /mpvcore/player/mp_core.h
parent5135e93d0cec05047aeced889bbf740a7d091012 (diff)
downloadmpv-227d087db601a02d4d71ea914f61e4d69fd34e6c.tar.bz2
mpv-227d087db601a02d4d71ea914f61e4d69fd34e6c.tar.xz
video: display last frame, drain frames on video reconfig
Until now, the player didn't care to drain frames on video reconfig. Instead, the VO was reconfigured (i.e. resized) before the queued frames finished displaying. This can for example be observed by passing multiple images with different size as mf:// filename. Then the window would resize one frame before image with the new size is displayed. With --vo=vdpau, the effect is worse, because this VO queues more than 1 frame internally. Fix this by explicitly draining buffered frames before video reconfig. Raise the display time of the last frame. Otherwise, the last frame would be shown for a very short time only. This usually doesn't matter, but helps when playing image files. This is a byproduct of frame draining, because normally, video timing is based on the frames queued to the VO, and we can't do that with frames of different size or format. So we pretend that the frame before the change is the last frame in order to time it. This code is incorrect though: it tries to use the framerate, which often doesn't make sense. But it's good enough to test this code with mf://.
Diffstat (limited to 'mpvcore/player/mp_core.h')
-rw-r--r--mpvcore/player/mp_core.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/mpvcore/player/mp_core.h b/mpvcore/player/mp_core.h
index 65b3b3dea2..607000cd5c 100644
--- a/mpvcore/player/mp_core.h
+++ b/mpvcore/player/mp_core.h
@@ -236,6 +236,11 @@ typedef struct MPContext {
// the goal of making flip() calls finish (rather than start) at the
// specified time.
double last_vo_flip_duration;
+ // Display duration (as "intended") of the last flipped frame.
+ double last_frame_duration;
+ // Set to true some time after a new frame has been shown, and it turns out
+ // that this frame was the last one before video ends.
+ bool playing_last_frame;
// How much video timing has been changed to make it match the audio
// timeline. Used for status line information only.
double total_avsync_change;
@@ -283,8 +288,8 @@ typedef struct MPContext {
double start_timestamp;
// Timestamp from the last time some timing functions read the
- // current time, in (occasionally wrapping) microseconds. Used
- // to turn a new time value to a delta from last time.
+ // current time, in microseconds.
+ // Used to turn a new time value to a delta from last time.
int64_t last_time;
// Used to communicate the parameters of a seek between parts
@@ -439,5 +444,6 @@ int reinit_video_filters(struct MPContext *mpctx);
double update_video(struct MPContext *mpctx, double endpts);
void mp_force_video_refresh(struct MPContext *mpctx);
void update_fps(struct MPContext *mpctx);
+void video_execute_format_change(struct MPContext *mpctx);
#endif /* MPLAYER_MP_CORE_H */