[MPlayer-dev-eng] [PATCH] Patch for better pause support.

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Tue Sep 2 20:49:27 CEST 2008


On Fri, Aug 29, 2008 at 03:20:06AM -0400, Robert Cummings wrote:
> On Tue, 2008-08-26 at 19:57 +0200, Reimar Döffinger wrote:
> > On Mon, Aug 25, 2008 at 02:09:18PM -0400, Robert Cummings wrote:
> > > On Thu, 2008-08-07 at 12:39 +0200, Reimar Doeffinger wrote:
> > > >
> > > > The basic idea seems sound, the implementation has a few rough edges though
> > > > like duplicating some of the code in the while(). I am also unsure if/how
> > > > this could be extended to handle get_property/set_property etc. properly.
> > > > Unless someone else steps up to work on it, you will have to wait until
> > > > I again have internet at home (probably around August 12th).
> > > 
> > > *bump* :)
> > 
> > Ok, my problem is do not know what exactly 90 % of the code is there
> > for,
> 
> 90% of which code? The code I added?

Yes.

Please check if attached patch does everything you need. I intend to
apply in two days and after someone confirms that they find it useful this
way.

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: mplayer.c
===================================================================
--- mplayer.c	(revision 27500)
+++ mplayer.c	(working copy)
@@ -2353,9 +2360,10 @@
 	mpctx->audio_out->pause();	// pause audio, keep data if possible
 
     while ( (cmd = mp_input_get_cmd(20, 1, 1)) == NULL
-            || cmd->id == MP_CMD_SET_MOUSE_POS) {
+            || cmd->id == MP_CMD_SET_MOUSE_POS || cmd->pausing == 4) {
 	if (cmd) {
 	  cmd = mp_input_get_cmd(0,1,0);
+	  run_command(mpctx, cmd);
 	  mp_cmd_free(cmd);
 	  continue;
 	}
Index: input/input.c
===================================================================
--- input/input.c	(revision 27500)
+++ input/input.c	(working copy)
@@ -771,6 +780,9 @@
   } else if (strncmp(str, "pausing_toggle ", 15) == 0) {
     pausing = 3;
     str = &str[15];
+  } else if (strncmp(str, "pausing_keep_force ", 19) == 0) {
+    pausing = 4;
+    str = &str[19];
   }
 
   for(ptr = str ; ptr[0] != '\0'  && ptr[0] != '\t' && ptr[0] != ' ' ; ptr++)
Index: DOCS/tech/slave.txt
===================================================================
--- DOCS/tech/slave.txt	(revision 27500)
+++ DOCS/tech/slave.txt	(working copy)
@@ -26,8 +26,12 @@
 it was already in paused mode. "pausing_toggle " tells MPlayer to do so
 only if it was not already in paused mode. Please note that "as soon as
 possible" can be before the command is fully executed.
+As a temporary hack, there is also the _experimental_ "pausing_keep_force "
+prefix, with which MPlayer will not exit the pause loop at all.
+Like this you can avoid the "frame stepping" effect of "pausing_keep "
+but most commands will either not work at all or behave in unexpected ways.
 
 
 Available commands ('mplayer -input cmdlist' will print a list):
 
 


More information about the MPlayer-dev-eng mailing list