diff options
author | Uoti Urpala <uau@mplayer2.org> | 2011-12-05 06:36:20 +0200 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-12-06 07:47:35 +0200 |
commit | 253f62c564443b93604f4bac610c6e7dc7f58824 (patch) | |
tree | 5271e93ea67928f6f5db5c34189cb9190a61116d /mplayer.c | |
parent | ad0348cf0a7459c0581deaf3ed7d8b73a12cc73f (diff) | |
download | mpv-253f62c564443b93604f4bac610c6e7dc7f58824.tar.bz2 mpv-253f62c564443b93604f4bac610c6e7dc7f58824.tar.xz |
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.
Diffstat (limited to 'mplayer.c')
-rw-r--r-- | mplayer.c | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -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); } |