[MPlayer-users] MPlayer and backslashes in .asx files ?

Joonas Koivunen rzei at mbnet.fi
Sun May 25 17:30:33 CEST 2003


On Saturday 24 May 2003 13:35, Joël Bourquard wrote:
> For the record, here's the script I came up with:
>
> #!/bin/bash
> PLAYER_CMD="mplayer -quiet -dr -fs -double -stop_xscreensaver"
> echo "$1" | grep ".asx" &>/dev/null
> if [ $? == 0 ]; then
>     sed "s%Files[\\]%$PWD/Files/%" "$1" | $PLAYER_CMD -playlist
> /dev/stdin
> else
>     $PLAYER_CMD "$1"
> fi
i'd like to add that afaik grep is case-sensitive. so if you transfer stuff 
from windows systems, you might end up with files with .ASX and your script 
not noticing those.. i have no knowledge when do these uppercase filenames 
happen, sometimes i just found ones..

> It tests whether the filename contains .asx, then uses sed to do the
> replacement.
using tr as Corey pointed out seems a bit more mplayer-like way to do it as 
it's cleaner :))

> Future improvements for it:
> - Enable support of '%' character in filenames
wouldn't using Coreys way deal with this problem?

> - Detect .asf at end of filenames only
isn't that something like egrep "^asx" hmm.. or did that match to the 
beginning? i'm not an expert in regular expressions, but that's the way to 
go..

> - Send correct commandline when playing video file outside current
> directory (how?).
hmm..
i'm not sure what you mean, but you might mean the script needing to be in 
/usr/bin or somewhere in your path..

> Again, thanks
>
> Joël

-rzei





More information about the MPlayer-users mailing list