From 253f62c564443b93604f4bac610c6e7dc7f58824 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Mon, 5 Dec 2011 06:36:20 +0200 Subject: core, vo: new window refresh logic, add slow-video OSD redraw Remove code refreshing window contents after events such as resize from vo_vdpau, vo_gl and vo_xv. Instead have them simply set a flag indicating that a refresh is needed, and have the player core perform that refresh by doing an OSD redraw. Also add support for updating the OSD contents over existing frames during slow-but-not-paused playback. The VOs now also request a refresh if parameters affecting the picture change (equalizer settings, colormatrix, VDPAU deinterlacing setting). Even previously the picture was typically redrawn with the new settings while paused because new OSD messages associated with setting changes triggered a redraw, but this did not happen if OSD was turned off. A minor imperfection is that now window system events can trigger a single one-frame step forward when using vo_xv after pausing so that vo_xv does not yet have a copy of the current image. This could be fixed but I think it's not important enough to bother. --- mplayer.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'mplayer.c') diff --git a/mplayer.c b/mplayer.c index 79407e85a3..f93fb38460 100644 --- a/mplayer.c +++ b/mplayer.c @@ -3087,11 +3087,10 @@ static void pause_loop(struct MPContext *mpctx) } if (mpctx->sh_video && mpctx->video_out) vo_check_events(mpctx->video_out); - usec_sleep(20000); update_osd_msg(mpctx); int hack = vo_osd_changed(0); vo_osd_changed(hack); - if (hack) + if (hack || mpctx->sh_video && mpctx->video_out->want_redraw) break; #ifdef CONFIG_STREAM_CACHE if (!opts->quiet && stream_cache_size > 0) { @@ -3829,21 +3828,25 @@ static void run_playloop(struct MPContext *mpctx) if (mpctx->stop_play) break; } - if (!mpctx->paused || mpctx->stop_play || mpctx->seek.type - || mpctx->restart_playback) + bool slow_video = mpctx->sh_video && mpctx->video_out->frame_loaded; + if (!(mpctx->paused || slow_video) || mpctx->stop_play + || mpctx->seek.type || mpctx->restart_playback) break; if (mpctx->sh_video) { update_osd_msg(mpctx); int hack = vo_osd_changed(0); vo_osd_changed(hack); - if (hack) { + if (hack || mpctx->video_out->want_redraw) { if (redraw_osd(mpctx) < 0) { - add_step_frame(mpctx); + if (mpctx->paused) + add_step_frame(mpctx); break; } else vo_osd_changed(0); } } + if (!mpctx->paused) + break; pause_loop(mpctx); } -- cgit v1.2.3