changeset 31882:ef30e1505969

Do not call *_aid_from_lang when audio_lang is NULL.
author reimar
date Mon, 16 Aug 2010 10:33:33 +0000
parents 238e9d01501f
children b14ca9b6b6d4
files mencoder.c mplayer.c
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mencoder.c	Sun Aug 15 00:07:13 2010 +0000
+++ b/mencoder.c	Mon Aug 16 10:33:33 2010 +0000
@@ -710,7 +710,7 @@
   mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_OpenedStream, file_format, (int)(stream->start_pos), (int)(stream->end_pos));
 
 if(stream->type==STREAMTYPE_BD){
-  if(audio_id==-1) audio_id=bd_aid_from_lang(stream,audio_lang);
+  if(audio_lang && audio_id==-1) audio_id=bd_aid_from_lang(stream,audio_lang);
   if(dvdsub_lang && dvdsub_id==-1) dvdsub_id=bd_sid_from_lang(stream,dvdsub_lang);
 }
 
--- a/mplayer.c	Sun Aug 15 00:07:13 2010 +0000
+++ b/mplayer.c	Mon Aug 16 10:33:33 2010 +0000
@@ -3345,14 +3345,14 @@
 }
 
 if(mpctx->stream->type==STREAMTYPE_BD){
-  if(audio_id==-1) audio_id=bd_aid_from_lang(mpctx->stream,audio_lang);
+  if(audio_lang && audio_id==-1) audio_id=bd_aid_from_lang(mpctx->stream,audio_lang);
   if(dvdsub_lang && dvdsub_id==-1) dvdsub_id=bd_sid_from_lang(mpctx->stream,dvdsub_lang);
 }
 
 #ifdef CONFIG_DVDREAD
 if(mpctx->stream->type==STREAMTYPE_DVD){
   current_module="dvd lang->id";
-  if(audio_id==-1) audio_id=dvd_aid_from_lang(mpctx->stream,audio_lang);
+  if(audio_lang && audio_id==-1) audio_id=dvd_aid_from_lang(mpctx->stream,audio_lang);
   if(dvdsub_lang && dvdsub_id==-1) dvdsub_id=dvd_sid_from_lang(mpctx->stream,dvdsub_lang);
   // setup global sub numbering
   mpctx->sub_counts[SUB_SOURCE_DEMUX] = dvd_number_of_subs(mpctx->stream);
@@ -3363,7 +3363,7 @@
 #ifdef CONFIG_DVDNAV
 if(mpctx->stream->type==STREAMTYPE_DVDNAV){
   current_module="dvdnav lang->id";
-  if(audio_id==-1) audio_id=mp_dvdnav_aid_from_lang(mpctx->stream,audio_lang);
+  if(audio_lang && audio_id==-1) audio_id=mp_dvdnav_aid_from_lang(mpctx->stream,audio_lang);
   dvdsub_lang_id = -3;
   if(dvdsub_lang && dvdsub_id==-1)
     dvdsub_lang_id=dvdsub_id=mp_dvdnav_sid_from_lang(mpctx->stream,dvdsub_lang);