[Mplayer-users] a fbdev helper script.

Jakub Turski yacoob at chruptak.plukwa.net
Fri Aug 10 19:40:58 CEST 2001


Greetings.

 I sent it here, I hope that nobody minds that?

 It's  a  little  script  I  wrote,  in order to ease using mplayer with
fbdev. As with -vo fbdev mplayer doesn't scale the movie, or change  the
resolution, here's a nice way to change it manually.

---8<---c-o-d-e---s-t-a-r-t-
#!/bin/sh

# where is dialog?
DIALOG=${DIALOG=dialog}

# normalization command
normalize="/usr/sbin/fbset 800x600 at 90-8"

# resolution names, menu preparing
res=`grep \^mode /etc/fb.modes | cut -f2 -d\" | cat -b `

tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
trap "rm -f $tempfile" 0 1 2 5 15

$DIALOG --shadow --clear --backtitle 'MPlayer resolution selection' \
	--menu "Choose resolution to play $1" \
		-1 -1 30 $res 2> $tempfile
		
	retval=$?

	input=`cat $tempfile`

	case $retval in
	  0)
		resolution=`grep \^mode /etc/fb.modes | cut -f2 -d\" | cat -b | grep "^ *$input	" | cut -f2`
		# there's no way to detect if mplayer quit by presing
		# 'q' or hasn't even started because of too small
		# resolution - it both end in error code = 1. So, there
		# will be no retry for user to select another
		# resolution... :((
		mplayer -fbmode $resolution "$@" &> /dev/null
	;;
	  1)
		echo "Well, if you don't want to...?"
	;;
	  255)
		echo "Running away, eh? So be it."
	;;
	esac

# this goes in case something went awfully wrong, i.e. user selected
# resolution which is too small for movie...
$normalize

# nice & clean
clear
---8<---c-o-d-e---s-t-a-r-t-

 If  someone  has  any  idea how can I do the 'retry stuff' mentioned in
comments above... feel free to tell me :>
 
Regards,

Q.
-- 
   __    __.---------------------------------------------------------------.__
  (oo)  |       36536 bytes in 8 lost chains - Convert to Taglines Y/N?       |
 / \/ \ |                                                                     |
 `V__V' `--.__penguin_#128720_______________________http://www.yacoob.z.pl_.--'

_______________________________________________
Mplayer-users mailing list
Mplayer-users at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-users



More information about the MPlayer-users mailing list