#!/bin/sh # MPlayer on the First Audio Stream. # Intended for use on MythTV .mpg files, which have multiple audio streams and # unpredictable stream IDs. As far as I can tell, the main audio is always the # lowest-numbered one; the others are typically audio description. # Adam Sampson aid="$((sleep 1; echo q) | mplayer -ao null -vo null -v "$@" 2>&1 | grep 'FOUND.*type=0x50' | sed 's,.*pid=[^ ]* (\([^)]*\)).*,\1,' | sort -n | head -1)" if [ "$aid" = "" ] ; then echo >&2 "mplayer-fas couldn't find aid list" exec mplayer "$@" else echo >&2 "mplayer-fas using aid '$aid'" exec mplayer -aid "$aid" "$@" fi