From patchwork Wed Mar 2 00:35:45 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "C.Y.M" X-Patchwork-Id: 11794 Received: from dialup-4.245.119.60.dial1.sanjose1.level3.net ([4.245.119.60] helo=nofear.bounceme.net) by www.linuxtv.org with esmtp (Exim 4.34) id 1D6HpZ-0007kL-Q6 for vdr@linuxtv.org; Wed, 02 Mar 2005 01:35:39 +0100 Received: from [10.1.1.66] (hades [10.1.1.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by nofear.bounceme.net (Postfix) with ESMTP id AE0C573526 for ; Tue, 1 Mar 2005 16:33:07 -0800 (PST) Message-ID: <42250A61.4070103@syphir.sytes.net> Date: Tue, 01 Mar 2005 16:35:45 -0800 From: "C.Y.M" Organization: CooLNeT User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Vdr Subject: [vdr] Is there a current Mplayer.sh for apid selection? References: <4224BDCD.50100@syphir.sytes.net> <4224EF34.4080108@altenhain.de> In-Reply-To: <4224EF34.4080108@altenhain.de> X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: syphir@syphir.sytes.net, Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Mar 2005 00:35:39 -0000 Status: O X-Status: X-Keywords: X-UID: 429 Lars Altenhain wrote: > Hi, > > C.Y.M schrieb: > >> Since Mplayer 0.9.8, there was a new option to select the audio pid >> during play back. There were a few patches floating around and the >> one attached to this email is what I am currently using against the >> current version of mplayer.sh. But, I am having a problem with this >> patch as it sometimes selects the secondary audio track (which is >> usually in a different language) and I am unable to get mplayer to use >> the primary apid. I have attached this patch as reference, but there >> is something still wrong with the audio selection. Does anyone have a >> working solution? >> >> Best Regards, >> > This effect is due to the different numbering scheme for audio tracks in > mpeg and avi files (avi: 1-99, mpeg: 0-31, see man mplayer). Some time > ago I had posted a patch for the mplayer.sh in the forum on vdrportal.de > (http://www.vdrportal.de/board/thread.php?postid=177058#post177058). > This patch increases the AID variable by 1 if an avi file is detected. > And it also checks if the selected audio track is available in the file. > If the selected audio track number is not present in the file, the -aid > parameter is not used in the mplayer command line. This patch is for an > older version of the mplayer.sh file, so I think it doesn't apply > without some small changes. > Thank you. I have created a new patch for mplayer.sh-0.8.6 using the information kindly provided. Best Regards, --- mplayer.sh.orig 2005-03-01 16:18:07.000000000 -0800 +++ mplayer.sh 2005-03-01 16:16:23.000000000 -0800 @@ -265,7 +259,7 @@ # output: variable ORIG_X and ORIG_Y (global) # variable definitions - local TEMP1 MPLAYER_RETURN + local TEMP1 VALID_AID AVI_FORMAT MPLAYER_RETURN ORIG_X=0; ORIG_Y=0 TEMP1=`$MPLAYER -identify -vo null -ao null -frames 0 "$FILE" 2>/dev/null | grep -i -e "^ID_"` @@ -297,6 +291,19 @@ AUDIO_CODEC=`echo "$TEMP1"|grep ID_AUDIO_CODEC|cut -d"=" -f2` debugmsg "parsed output for AUDIO_CODEC:" $AUDIO_CODEC + AVI_FORMAT=`file "$FILE" 2>/dev/null | grep -i -e "AVI"` + if test "$AVI_FORMAT" != ""; then + echolog "AVI format detected, increasing audiostreamid by 1" + AID=$(($AID+1)) + fi + + VALID_AID=`$MPLAYER -aid $AID -identify -vo null -ao null -frames 0 "$FILE" 2>/dev/null | grep -i -e "^ID_AUDIO"` + + if test "$VALID_AID" == ""; then + echolog "selected audiostream not in file, using default" + AID=-1; + fi + return; } @@ -481,7 +488,8 @@ declare ORIG_FPS NEW_FPS ORIG_ASPECT VIDEO_FORMAT AUDIO_CODEC declare CMDLINE AOUT REMOTE USERDEF SUFFIX declare FILE="$1" -declare SLAVE="$2" +declare AID="$2" +declare SLAVE="$3" declare -a XResPAL[0] declare -a XResNTSC[0] declare FDSTR="" @@ -552,6 +562,9 @@ fi fi +# small patch: +if test $AID -gt 0; then CMDLINE="$CMDLINE -aid $AID"; fi + debugvar CMDLINE "$CMDLINE" exec $CMDLINE "$FILE" exit