[MPlayer-users] Frame-by-frame scrubbing

Ville Saari 113762 at foo.bar.org
Wed May 5 16:20:32 CEST 2004


On Tue, May 04, 2004 at 05:48:42PM -0400, D Richard Felker III wrote:

> > Any chance Mplayer could/would support frame-by-frame scrubbing?
> 
> Current MPlayer, no, probably never. Keep on the lookout for something
> else tho in the future!

Frame-by-frame stepping in forward direction only is trivial to implement.
Attached patch to mplayer.c modifies it so that if you unpause mplayer
with any cursor key, then it will play only one frame and pause again.

It's a dirty hack - I don't expect it to be added to cvs, but a similar
feature in the official mplayer would be nice. My hack messes up the
audio sync, if you step lots of frames. Apparently mplayer pauses the
audio a bit late and when you play only one frame, it has no time to
resync so the error accumulates and when you finally resume normal
playback, then mplayer plays video in fast-forward for a while to
catch up. At least that's what seems to happen while playing mpeg4+mp3
avis using oss audio.

The patch is diffed against 1.0pre4, not the current cvs.

-- 
 Ville
-------------- next part --------------
--- ../MPlayer-1.0pre4/mplayer.c	2004-04-27 00:15:13.000000000 +0300
+++ mplayer.c	2004-05-05 17:08:46.000000000 +0300
@@ -747,6 +747,7 @@
 
 int gui_no_filename=0;
 
+int autopause=0;
 
   srand((int) time(NULL)); 
 
@@ -2406,7 +2407,7 @@
   }
 #endif
 
-  if(osd_function==OSD_PAUSE){
+  if(osd_function==OSD_PAUSE || autopause){
     mp_cmd_t* cmd;
       if(!quiet) {
 	mp_msg(MSGT_CPLAYER,MSGL_STATUS,MSGTR_Paused);
@@ -2436,6 +2437,9 @@
 #endif
              usec_sleep(20000);
          }
+
+      autopause=cmd->id==MP_CMD_SEEK;
+
       mp_cmd_free(cmd);
          osd_function=OSD_PLAY;
       if (audio_out && sh_audio)


More information about the MPlayer-users mailing list