Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Slave mode - detecting end of file.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Edd Barrett  
View profile  
 More options Feb 28 2011, 4:28 am
From: Edd Barrett <vex...@gmail.com>
Date: Mon, 28 Feb 2011 09:28:27 +0000
Local: Mon, Feb 28 2011 4:28 am
Subject: [MPlayer-users] Slave mode - detecting end of file.
Hi there,

I have been googling around for a while trying to figure out how I can
detect when a song has finished playing on an instance of mplayer in
(idle) slave mode. My application is unable to queue multiple songs in
an mplayer slave because the playlist ordering is subject to change,
so it is vital I find a way to know when a song has ended.

I found an almost identical question here:
http://lists.mplayerhq.hu/pipermail/mplayer-users/2005-December/05706...

If you follow up the thread you eventually find reference to a patch
which did more or less this, but was abandoned.

So my question is, has anything changed since then? If not, can i
suggest that an idle mplayer slave should still repond to commands
even if nothing is playing?

So perhaps "get_file_name" might respond "FILE_NAME: <null>", which
can then be picked up by the master application. As it stands, mplayer
says nothing if nothing is playing, so read()s on a named pipe will
just block; this encourages people to write time sensitive code, which
I am dismissing on the grounds that it is too difficult to avoid race
conditions.

Another idea: Perhaps, you can pass a PID to an mplayer slave so that
mplayer can send a SIGUSR1 to the master, indicating the end of a
track?

For now my application will just fork a new mplayer for each track, as
i can easily detect the end of a track using a wait() or waitpid().

Any thoughts?

Cheers.

--
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk
_______________________________________________
MPlayer-users mailing list
MPlayer-us...@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oliver Seitz  
View profile  
 More options Feb 28 2011, 5:29 am
From: Oliver Seitz <i...@vtnd.de>
Date: Mon, 28 Feb 2011 11:29:52 +0100
Local: Mon, Feb 28 2011 5:29 am
Subject: Re: [MPlayer-users] Slave mode - detecting end of file.

> I have been googling around for a while trying to figure out how I can
> detect when a song has finished playing on an instance of mplayer in
> (idle) slave mode.

How about checking stdout? While playing, you'll get an output every 0.1
seconds or so, if there is no data for more than 0.2 seconds, the file
has ended.

Or, in the output is both the position and the duration:

A: 299.2 (04:59.2) of 299.0 (04:59.0)  1.5%

If both is the same, the file should be over.

Greets,
Kiste
_______________________________________________
MPlayer-users mailing list
MPlayer-us...@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Edd Barrett  
View profile  
 More options Feb 28 2011, 5:33 am
From: Edd Barrett <vex...@gmail.com>
Date: Mon, 28 Feb 2011 10:33:55 +0000
Local: Mon, Feb 28 2011 5:33 am
Subject: Re: [MPlayer-users] Slave mode - detecting end of file.
Hi,

On Mon, Feb 28, 2011 at 10:29 AM, Oliver Seitz <i...@vtnd.de> wrote:

>> I have been googling around for a while trying to figure out how I can
>> detect when a song has finished playing on an instance of mplayer in
>> (idle) slave mode.

> How about checking stdout? While playing, you'll get an output every 0.1
> seconds or so, if there is no data for more than 0.2 seconds, the file has
> ended.

> Or, in the output is both the position and the duration:

> A: 299.2 (04:59.2) of 299.0 (04:59.0)  1.5%

We thought of solutions like this, however I think we could sill
exploir race conditions if we put the system under substantial load.

A more robust solution is needed.

Thanks

--
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk
_______________________________________________
MPlayer-users mailing list
MPlayer-us...@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Phil Rhodes  
View profile  
 More options Feb 28 2011, 6:02 am
From: "Phil Rhodes" <phil_rho...@rocketmail.com>
Date: Mon, 28 Feb 2011 11:02:28 -0000
Local: Mon, Feb 28 2011 6:02 am
Subject: Re: [MPlayer-users] Slave mode - detecting end of file.

>> A: 299.2 (04:59.2) of 299.0 (04:59.0)  1.5%

There are certainly situations where this never actually appears.

P
_______________________________________________
MPlayer-users mailing list
MPlayer-us...@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Edd Barrett  
View profile  
 More options Feb 28 2011, 6:17 am
From: Edd Barrett <vex...@gmail.com>
Date: Mon, 28 Feb 2011 11:17:56 +0000
Local: Mon, Feb 28 2011 6:17 am
Subject: Re: [MPlayer-users] Slave mode - detecting end of file.
2011/2/28 Phil Rhodes <phil_rho...@rocketmail.com>:

>>> A: 299.2 (04:59.2) of 299.0 (04:59.0)  1.5%

> There are certainly situations where this never actually appears.

Yup.

If you look at mplayer.c (trunk) line 3082, we see that when nothing
is playing, mplayer will only respond to:
MP_CMD_LOADFILE, MP_CMD_LOADLIST, MP_CMD_QUIT, MP_CMD_VO_FULLSCREEN,
MP_CMD_GET_PROPERTY,  MP_CMD_SET_PROPERTY, MP_CMD_STEP_PROPERTY.

I am going to reccommend it responds to MP_CMD_GET_FILENAME too.

Will have a diff soon (if it works), but I am snowed under with real
work, so bear with me.

--
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk
_______________________________________________
MPlayer-users mailing list
MPlayer-us...@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oliver Seitz  
View profile  
 More options Feb 28 2011, 6:30 am
From: Oliver Seitz <i...@vtnd.de>
Date: Mon, 28 Feb 2011 12:30:12 +0100
Local: Mon, Feb 28 2011 6:30 am
Subject: Re: [MPlayer-users] Slave mode - detecting end of file.

>>> A: 299.2 (04:59.2) of 299.0 (04:59.0) 1.5%

> There are certainly situations where this never actually appears.

Or far before the end is reached. It was at most the second best approach...

Greets,
Kiste
_______________________________________________
MPlayer-users mailing list
MPlayer-us...@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Edd Barrett  
View profile  
 More options Feb 28 2011, 8:25 am
From: Edd Barrett <vex...@gmail.com>
Date: Mon, 28 Feb 2011 13:25:30 +0000
Local: Mon, Feb 28 2011 8:25 am
Subject: Re: [MPlayer-users] Slave mode - detecting end of file.

Something like this. Note the lack of single quotes indicating that this is not
a literal filename.

Index: mplayer.c
===================================================================
--- mplayer.c   (revision 32981)
+++ mplayer.c   (working copy)
@@ -3101,6 +3101,9 @@
         case MP_CMD_QUIT:
             exit_player_with_rc(EXIT_QUIT, (cmd->nargs > 0)? cmd->args[0].v.i : 0);
             break;
+        case MP_CMD_GET_FILENAME:
+            mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_FILENAME=(none)\n");
+           break;
         case MP_CMD_VO_FULLSCREEN:
         case MP_CMD_GET_PROPERTY:
         case MP_CMD_SET_PROPERTY:

--
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk
_______________________________________________
MPlayer-users mailing list
MPlayer-us...@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Reimar Döffinger  
View profile  
 More options Feb 28 2011, 12:33 pm
From: Reimar Döffinger <Reimar.Doeffin...@gmx.de>
Date: Mon, 28 Feb 2011 18:33:04 +0100
Local: Mon, Feb 28 2011 12:33 pm
Subject: Re: [MPlayer-users] Slave mode - detecting end of file.

You should just use get_property filename, the direct cmd stuff really
should be considered deprecated where a coresponding property exists.
_______________________________________________
MPlayer-users mailing list
MPlayer-us...@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom Evans  
View profile  
 More options Feb 28 2011, 4:05 pm
From: Tom Evans <tevans...@googlemail.com>
Date: Mon, 28 Feb 2011 21:05:44 +0000
Local: Mon, Feb 28 2011 4:05 pm
Subject: Re: [MPlayer-users] Slave mode - detecting end of file.

You don't need a patch to do this:

really-quiet=1
msglevel=statusline=6
msglevel=global=6

When mplayer reaches the end of the file, it will emit a message like so:

EOF code: 0

Cheers

Tom
_______________________________________________
MPlayer-users mailing list
MPlayer-us...@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »