[mythtv-users] Autoloading subtitles with xine?

Petr Stehlik pstehlik at sophics.cz
Mon Dec 26 17:51:22 EST 2005


Simon Lundell píše v Po 26. 12. 2005 v 23:03 +0100:
> > I would have waited a couple of days if i were you. The script does 
> > not handle filenames with spaces that well yet...
> 
> I can not get it to work! My guess is that the spaces (and other special 
> chars) don't get escaped correctly when passed to xine. I have no idea 
> how to do that, I must have tried every combination of qouting, bot no go...

Try this. Tested. Works fine.

#!/bin/bash
FILE="$@"
DIR=`dirname "$FILE"`
SUB=`basename "$FILE" ".${FILE##*.}"`
SUB1="$SUB*.sub"
SUB2="$SUB*.srt"
SUB3="$SUB*.txt"
SUBT=`find "$DIR" -maxdepth 1 -type f -and \( -name "$SUB1" -or -name
"$SUB2" -or -name "$SUB3" \) | head -n 1`
if [ -n "$SUBT" ]
then
	FILE="$FILE#subtitle:$SUBT"
fi
xine -pfhq --no-logo --no-splash -V xv "$FILE"

Petr




More information about the mythtv-users mailing list