summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-12 23:17:35 +0200
committerwm4 <wm4@nowhere>2014-08-12 23:24:08 +0200
commit5ed7bc6321119365dc1a5d330774e32ac6b6a54e (patch)
tree941486fbb0c2e21fc093e55b7cbc8dfe08a370c6 /player/loadfile.c
parentdf58e822377af0a3802bba862de80eafaea732cb (diff)
downloadmpv-5ed7bc6321119365dc1a5d330774e32ac6b6a54e.tar.bz2
mpv-5ed7bc6321119365dc1a5d330774e32ac6b6a54e.tar.xz
video: fix and simplify video format changes and last frame display
The previous commit broke these things, and fixing them is separate in this commit in order to reduce the volume of changes. Move the image queue from the VO to the playback core. The image queue is a remnant of the old way how vdpau was implemented, and increasingly became more and more an artifact. In the end, it did only one thing: computing the duration of the current frame. This was done by taking the PTS difference between the current and the future frame. We keep this, but by moving it out of the VO, we don't have to special-case format changes anymore. This simplifies the code a lot. Since we need the queue to compute the duration only, a queue size larger than 2 makes no sense, and we can hardcode that. Also change how the last frame is handled. The last frame is a bit of a problem, because video timing works by showing one frame after another, which makes it a special case. Make the VO provide a function to notify us when the frame is done, instead. The frame duration is used for that. This is not perfect. For example, changing playback speed during the last frame doesn't update the end time. Pausing will not stop the clock that times the last frame. But I don't think this matters for such a corner case.
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index a941f7af68..18a225568e 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -111,6 +111,7 @@ void uninit_player(struct MPContext *mpctx, unsigned int mask)
if (mask & INITIALIZED_VCODEC) {
mpctx->initialized_flags &= ~INITIALIZED_VCODEC;
+ reset_video_state(mpctx);
if (mpctx->d_video)
video_uninit(mpctx->d_video);
mpctx->d_video = NULL;