summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-12-04 18:10:17 +0200
committerUoti Urpala <uau@mplayer2.org>2011-12-06 02:55:13 +0200
commitc9553ce82fdb80811196f40b9c1eaaa3b2351e01 (patch)
tree8a0068a1f2654637bcd90a9c8529016f568078d1 /mplayer.c
parent421c840b3c061de89b426244fe75237a73f765de (diff)
downloadmpv-c9553ce82fdb80811196f40b9c1eaaa3b2351e01.tar.bz2
mpv-c9553ce82fdb80811196f40b9c1eaaa3b2351e01.tar.xz
vo: do final frame draw only near page flip
Separate passing a new frame to VOs using the new API into two steps. The first, vo_draw_image(), happens after a new frame is available from the filter chain. In constrast to old behavior, now the frame is not actually rendered yet at this point (though possible slice draw calls can already reach the VO before). The second step, vo_new_frame_imminent(), happens when we're close enough to the display time of the new frame that we'll commit to flipping it as the next action and will not change the OSD over the previous frame any more. This new behavior fixes a previous problem with vo_vdpau and vo_gl in the situation where the player is paused after decoding a new frame but before flipping it; previously changing OSD in that state would switch to the new frame as a side effect. It would also allow an easy way to fix extra output files produced with something like "--vo=png --frames=1" with precise seeking, but this is not done yet. The code now relies on a new mp_image from the filter chain staying valid even after the vf_vo put_image() call providing it returns. In other words decoders/filters must not deallocate or otherwise invalidate their output frame between passing it forward and returning from the decode/filter call.
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/mplayer.c b/mplayer.c
index dec68c83fd..041d0d5298 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -3672,6 +3672,7 @@ static void run_playloop(struct MPContext *mpctx)
current_module = "flip_page";
if (!frame_time_remaining && blit_frame) {
+ vo_new_frame_imminent(mpctx->video_out);
struct sh_video *sh_video = mpctx->sh_video;
mpctx->video_pts = sh_video->pts;
update_subtitles(mpctx, sh_video->pts, mpctx->video_offset, false);