[PATCH] add slave command for stop playback without to quit MPlayer (useful with -idle)
Hello, I suggest this patch for add a new slave command 'stop' for stop a playback without to quit MPlayer. I'm not sure if the way of this patch is right or not!!! My knowledges of MPlayer are limited!! The reason for this patch is simple. With libplayer.geexbox.org, MPlayer is loaded only at the init with -idle. And currently I use a ugly hack for stop a stream without to quit MPlayer. For that, I send the command `loadfile ""` then at least the playback is stopped and no new file is loaded. The -idle is IMHO a good reason for have this slave command in MPlayer. Regards, -- Mathieu SCHROETER
On Thu, 06 Mar 2008 18:36:13 +0100, Mathieu SCHROETER wrote:
Hello,
dont forget to edit the table at the bottom of slave.txt -compn
On Thu, Mar 06, 2008 at 06:36:13PM +0100, Mathieu SCHROETER wrote:
--- DOCS/tech/slave.txt (r??vision 26185) +++ DOCS/tech/slave.txt (copie de travail) @@ -266,6 +266,9 @@
+stop + Stop the playback.
Stop playback.
--- DOCS/man/en/mplayer.1 (r??vision 26185) +++ DOCS/man/en/mplayer.1 (copie de travail) @@ -232,6 +232,8 @@ +.IPs "U\ \ \ \ " +Stop playing (and quit if -idle not used).
Stop playing (and quit if \-idle is not used).
--- mplayer.c (r??vision 26185) +++ mplayer.c (copie de travail) @@ -3974,6 +3974,9 @@ mpctx->playtree_iter = NULL; } } +} else if (mpctx->eof == PT_STOP) { + play_tree_iter_free(mpctx->playtree_iter); + mpctx->playtree_iter = NULL; } else { // NEXT PREV SRC mpctx->eof = mpctx->eof == PT_PREV_SRC ? -1 : 1; }
Please indent this code with 4 spaces where appropriate. Diego
Hi, Diego Biurrun a écrit :
On Thu, Mar 06, 2008 at 06:36:13PM +0100, Mathieu SCHROETER wrote:
--- DOCS/tech/slave.txt (r??vision 26185) +++ DOCS/tech/slave.txt (copie de travail) @@ -266,6 +266,9 @@
+stop + Stop the playback.
Stop playback.
Ok.
--- DOCS/man/en/mplayer.1 (r??vision 26185) +++ DOCS/man/en/mplayer.1 (copie de travail) @@ -232,6 +232,8 @@ +.IPs "U\ \ \ \ " +Stop playing (and quit if -idle not used).
Stop playing (and quit if \-idle is not used).
Ok, I've also fixed in the french part.
--- mplayer.c (r??vision 26185) +++ mplayer.c (copie de travail) @@ -3974,6 +3974,9 @@ mpctx->playtree_iter = NULL; } } +} else if (mpctx->eof == PT_STOP) { + play_tree_iter_free(mpctx->playtree_iter); + mpctx->playtree_iter = NULL; } else { // NEXT PREV SRC mpctx->eof = mpctx->eof == PT_PREV_SRC ? -1 : 1; }
Please indent this code with 4 spaces where appropriate.
Mmmmh.. I think that the problem is not the indent of my patch but the lines 3976 and 3981 (with patch applied). The line 3976 uses 3 spaces and the line 3981 uses 5 spaces. All others lines of this "if {} else if {} [...] else {}" use *2* spaces. In this case I propose a cosmetic patch at least for this part. Sorry for my crappy english. Regards, Mathieu SCHROETER
On Fri, Mar 07, 2008 at 03:19:30PM +0100, Mathieu SCHROETER wrote:
Diego Biurrun a écrit :
On Thu, Mar 06, 2008 at 06:36:13PM +0100, Mathieu SCHROETER wrote:
--- mplayer.c (r??vision 26185) +++ mplayer.c (copie de travail) @@ -3974,6 +3974,9 @@ mpctx->playtree_iter = NULL; } } +} else if (mpctx->eof == PT_STOP) { + play_tree_iter_free(mpctx->playtree_iter); + mpctx->playtree_iter = NULL; } else { // NEXT PREV SRC mpctx->eof = mpctx->eof == PT_PREV_SRC ? -1 : 1; }
Please indent this code with 4 spaces where appropriate.
Mmmmh.. I think that the problem is not the indent of my patch but the lines 3976 and 3981 (with patch applied). The line 3976 uses 3 spaces and the line 3981 uses 5 spaces. All others lines of this "if {} else if {} [...] else {}" use *2* spaces.
Fixed :) Now please update your patch accordingly. Diego
Diego Biurrun a écrit :
On Fri, Mar 07, 2008 at 03:19:30PM +0100, Mathieu SCHROETER wrote:
Diego Biurrun a écrit :
On Thu, Mar 06, 2008 at 06:36:13PM +0100, Mathieu SCHROETER wrote:
--- mplayer.c (r??vision 26185) +++ mplayer.c (copie de travail) @@ -3974,6 +3974,9 @@ mpctx->playtree_iter = NULL; } } +} else if (mpctx->eof == PT_STOP) { + play_tree_iter_free(mpctx->playtree_iter); + mpctx->playtree_iter = NULL; } else { // NEXT PREV SRC mpctx->eof = mpctx->eof == PT_PREV_SRC ? -1 : 1; } Please indent this code with 4 spaces where appropriate. Mmmmh.. I think that the problem is not the indent of my patch but the lines 3976 and 3981 (with patch applied). The line 3976 uses 3 spaces and the line 3981 uses 5 spaces. All others lines of this "if {} else if {} [...] else {}" use *2* spaces.
Fixed :) Now please update your patch accordingly.
Thanks, patch updated. Regards, Mathieu
Mathieu SCHROETER a écrit :
Diego Biurrun a écrit :
On Fri, Mar 07, 2008 at 03:19:30PM +0100, Mathieu SCHROETER wrote:
Diego Biurrun a écrit :
On Thu, Mar 06, 2008 at 06:36:13PM +0100, Mathieu SCHROETER wrote:
--- mplayer.c (r??vision 26185) +++ mplayer.c (copie de travail) @@ -3974,6 +3974,9 @@ mpctx->playtree_iter = NULL; } } +} else if (mpctx->eof == PT_STOP) { + play_tree_iter_free(mpctx->playtree_iter); + mpctx->playtree_iter = NULL; } else { // NEXT PREV SRC mpctx->eof = mpctx->eof == PT_PREV_SRC ? -1 : 1; } Please indent this code with 4 spaces where appropriate. Mmmmh.. I think that the problem is not the indent of my patch but the lines 3976 and 3981 (with patch applied). The line 3976 uses 3 spaces and the line 3981 uses 5 spaces. All others lines of this "if {} else if {} [...] else {}" use *2* spaces.
Fixed :) Now please update your patch accordingly.
Thanks, patch updated.
Ping.. something wrong? Regards, Mathieu
Mathieu SCHROETER a écrit :
Mathieu SCHROETER a écrit :
Diego Biurrun a écrit :
On Fri, Mar 07, 2008 at 03:19:30PM +0100, Mathieu SCHROETER wrote:
Diego Biurrun a écrit :
On Thu, Mar 06, 2008 at 06:36:13PM +0100, Mathieu SCHROETER wrote:
--- mplayer.c (r??vision 26185) +++ mplayer.c (copie de travail) @@ -3974,6 +3974,9 @@ mpctx->playtree_iter = NULL; } } +} else if (mpctx->eof == PT_STOP) { + play_tree_iter_free(mpctx->playtree_iter); + mpctx->playtree_iter = NULL; } else { // NEXT PREV SRC mpctx->eof = mpctx->eof == PT_PREV_SRC ? -1 : 1; } Please indent this code with 4 spaces where appropriate. Mmmmh.. I think that the problem is not the indent of my patch but the lines 3976 and 3981 (with patch applied). The line 3976 uses 3 spaces and the line 3981 uses 5 spaces. All others lines of this "if {} else if {} [...] else {}" use *2* spaces.
Fixed :) Now please update your patch accordingly.
Thanks, patch updated.
Ping..
something wrong?
Applied. Ben
participants (4)
-
Benjamin Zores -
Compn -
Diego Biurrun -
Mathieu SCHROETER