[MPlayer-dev-eng] running a program with a keystroke - passing playing filename to it

Elias Gabriel Amaral da Silva tolkiendili at gmail.com
Tue Dec 21 13:33:40 CET 2010

2010/12/19 Elias Gabriel Amaral da Silva <tolkiendili at gmail.com>:
> 2010/12/17 Reimar Döffinger <Reimar.Doeffinger at gmx.de>:

>> However being able to use arbitrary properties in commands might
>> be a useful feature.
> I implemented it, just for filename.

Attached is an implementation for MPLAYER_POS and MPLAYER_LEN as well.
I talked with some people at #mplayerdev about it. It was suggested
that I should avoid putting complexity at the code and do it with a
slave mode wrapper. In my understanding, it would have to open some
channel (such as an unix socket), and the command run would have to
ask it for such data through this channel. Also, the wrapper would
have to
handle UI. This would too complex.

Also uau suggested that instead of keeping hard-coded environment
variables (since the list of them could grow), one should expand
mplayer variables on run parameter, like osd_show_property_text does.
An issue would be how to handle multiple parameters, but it seems that
string parameters already get " escaped, so one could write this

run "my_script \"${filename}\" \"${length}\" \"${time_pos}\""

Where ${filename} would (deceptively) be expanded by mplayer, not by the shell.

In any case, it seems this feature haven't attracted much interest,
since it does something that could ultimately be done by slave mode.
Uau seems unsure whether my feature is worth enough to be merged, even
if I implement it in a more general fashion like he suggested. And I
admit that may be the case that it will be useful just for me.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-command.c-setting-environment-variables-on-run-comma.patch
Type: text/x-patch
Size: 2565 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20101221/6e0856af/attachment.bin>

More information about the MPlayer-dev-eng mailing list