[MPlayer-users] Quoting and manipulating variables in mplayer slave mode

David Liontooth lionteeth at cogweb.net
Sun Apr 24 23:27:44 CEST 2011


On 04/24/2011 11:56 AM, Reimar Döffinger wrote:
>> Is this correct? And there's no way to do on-the-fly string
>> >  manipulations in this second case?
> Of course there is, probably something like
> echo "osd_show_property_text \"\${filename}\" 1000 0"
> But that is exclusively a propert of your shell and has nothing
> at all to do with MPlayer, just look at the output of just
> running the "echo" without redirecting it to MPlayer.
> Either way this is rather the wrong place to ask since it
> doesn't really have much to to with MPlayer itself.echo "osd_show_text '${FIL//_/ }' 1000 0">  $FIFO

Reimar is missing the point here -- we're talking about retrieving a 
property value from mplayer by passing a variable (and outputting to 
OSD); I can't reproduce that in the shell.

To spell it out, I could mimic the process in my vanilla bash shell by 
defining a local variable:

filename="this_is_London"

   echo 'osd_show_property_text "${filename}" 1000 0'

Does not expand variable

   echo "osd_show_property_text "${filename}" 1000 0"

Expands variable

   echo "osd_show_property_text "${filename//_/ }" 1000 0"

Expands variable and removes underscores.

Passing these commands to mplayer via fifo gives these results:

     echo 'osd_show_property_text "${filename}" 1000 0' > $FIFO

Expands variable (property value is retrieved and displayed in OSD)

   echo "osd_show_property_text "${filename}" 1000 0" > $FIFO

Does not expand variable (property value is not retrieved).

   echo "osd_show_property_text "${filename//_/ }" 1000 0" > $FIFO

Does not expand variable (property value is not retrieved).

In short, opposite results. Since what I'm asking about involves 
retrieving a property value from mplayer by passing a variable, there's 
no way I can reproduce this by echoing something in my shell.

Again, is there a way to manipulate these property values on the fly? 
I'm feeling pretty confident the answer is no.

Cheers,
Dave




More information about the MPlayer-users mailing list