summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2008-12-01 19:53:57 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2008-12-09 04:31:07 +0200
commit02efad79a28345e5814af1b60e0bb3c40cb5a941 (patch)
tree83c164e897ed46b24701f8190412d2883f085ba2 /mplayer.c
parent95f35c4d205daafe4797f28d7ec79f3ebb1952a1 (diff)
downloadmpv-02efad79a28345e5814af1b60e0bb3c40cb5a941.tar.bz2
mpv-02efad79a28345e5814af1b60e0bb3c40cb5a941.tar.xz
Update OSD while paused
When OSD contents change while paused, try to change the OSD drawn in the currently visible frame. If such OSD updates are not supported then advance by one frame and draw the OSD normally. Add some support for OSD redrawing to vo xv. The new xv code makes a copy of the original frame contents before drawing the OSD if MPlayer is already paused when the frame is drawn. If such a copy of the current frame exists then the frame contents can be restored and a different OSD drawn on top of the same frame.
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c32
1 files changed, 25 insertions, 7 deletions
diff --git a/mplayer.c b/mplayer.c
index 0ccb31b8aa..36e6c5d5f8 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -2322,7 +2322,6 @@ void pause_player(struct MPContext *mpctx)
if (mpctx->paused)
return;
mpctx->paused = 1;
- mpctx->osd_function = OSD_PAUSE;
mpctx->step_frames = 0;
mpctx->time_frame -= get_relative_time(mpctx);
@@ -2338,15 +2337,23 @@ void unpause_player(struct MPContext *mpctx)
if (!mpctx->paused)
return;
mpctx->paused = 0;
- mpctx->osd_function = OSD_PLAY;
if (mpctx->audio_out && mpctx->sh_audio)
mpctx->audio_out->resume(); // resume audio
- if (mpctx->video_out && mpctx->sh_video && mpctx->video_out->config_ok)
+ if (mpctx->video_out && mpctx->sh_video && mpctx->video_out->config_ok
+ && !mpctx->step_frames)
vo_control(mpctx->video_out, VOCTRL_RESUME, NULL); // resume video
(void)get_relative_time(mpctx); // ignore time that passed during pause
}
+void add_step_frame(struct MPContext *mpctx)
+{
+ mpctx->step_frames++;
+ if (mpctx->video_out && mpctx->sh_video && mpctx->video_out->config_ok)
+ vo_control(mpctx->video_out, VOCTRL_PAUSE, NULL);
+ unpause_player(mpctx);
+}
+
static void pause_loop(struct MPContext *mpctx)
{
mp_cmd_t* cmd;
@@ -3781,6 +3788,8 @@ if(!mpctx->sh_video) {
mpctx->stop_play = PT_NEXT_ENTRY;
goto goto_next_file;
}
+ if (blit_frame)
+ vo_osd_changed(0);
if (frame_time < 0)
mpctx->stop_play = AT_END_OF_FILE;
else {
@@ -3905,11 +3914,20 @@ if(auto_quality>0){
if (mpctx->stop_play)
break;
}
- if (mpctx->paused && !(mpctx->stop_play || mpctx->rel_seek_secs
- || mpctx->abs_seek_pos))
- pause_loop(mpctx);
- else
+ if (!mpctx->paused || mpctx->stop_play || mpctx->rel_seek_secs
+ || mpctx->abs_seek_pos)
break;
+ if (mpctx->sh_video) {
+ update_osd_msg(mpctx);
+ int hack = vo_osd_changed(0);
+ vo_osd_changed(hack);
+ if (hack)
+ if (redraw_osd(mpctx->sh_video, mpctx->osd) < 0) {
+ add_step_frame(mpctx);
+ break;
+ }
+ }
+ pause_loop(mpctx);
}
}