[MPlayer-users] MPlayer and backslashes in .asx files ?
numlock at freesurf.ch
Sat May 24 12:35:16 CEST 2003
Thanks a lot Joonas and Corey !
For the record, here's the script I came up with:
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
It tests whether the filename contains .asx, then uses sed to do the
Future improvements for it:
- Enable support of '%' character in filenames
- Detect .asf at end of filenames only
- Send correct commandline when playing video file outside current
I'll try that 'tr' command, it looks simpler than sed. I haven't heard
of $@ before ;-)
> Joonas Koivunen wrote:
> > if that's not an option, with a simple script you could accomplish
> > it..
> Yes, and to give a hint:
> $ cat playlist.asx | tr '\\' /
> I don't think that'll break anything, but I don't deal with asx files at
> all. Make sure there never occur any backslashes for anything other than
> DOS-style paths.
> The rest just depends on how you want to set it up. You could make a
> simple wrapper something like:
> cat $1 | tr '\\' / > /tmp/playlist
> shift 1
> mplayer -playlist /tmp/playlist $@
More information about the MPlayer-users