[MPlayer-cvslog] r29829 - trunk/stream/stream_dvdnav.c

reimar subversion at mplayerhq.hu
Thu Nov 5 22:22:39 CET 2009


Author: reimar
Date: Thu Nov  5 22:22:38 2009
New Revision: 29829

Log:
Make the dvdnav stream language information output more similar to the dvd one.

Modified:
   trunk/stream/stream_dvdnav.c

Modified: trunk/stream/stream_dvdnav.c
==============================================================================
--- trunk/stream/stream_dvdnav.c	Thu Nov  5 22:13:38 2009	(r29828)
+++ trunk/stream/stream_dvdnav.c	Thu Nov  5 22:22:38 2009	(r29829)
@@ -517,9 +517,9 @@ static void show_audio_subs_languages(dv
   uint8_t lg;
   uint16_t i, lang, format, id, channels;
   int base[7] = {128, 0, 0, 0, 160, 136, 0};
-  char tmp[3];
   for(i=0; i<8; i++)
   {
+    char tmp[] = "unknown";
     lg = dvdnav_get_audio_logical_stream(nav, i);
     if(lg == 0xff) continue;
     channels = dvdnav_audio_stream_channels(nav, lg);
@@ -528,14 +528,12 @@ static void show_audio_subs_languages(dv
     else
       channels--;
     lang = dvdnav_audio_stream_to_lang(nav, lg);
-    if(lang == 0xFFFF)
-      tmp[0] = tmp[1] = '?';
-    else
+    if(lang != 0xFFFF)
     {
       tmp[0] = lang >> 8;
       tmp[1] = lang & 0xFF;
+      tmp[2] = 0;
     }
-    tmp[2] = 0;
     format = dvdnav_audio_stream_format(nav, lg);
     if(format == 0xFFFF || format > 6)
       format = 1; //unknown
@@ -550,18 +548,16 @@ static void show_audio_subs_languages(dv
 
   for(i=0; i<32; i++)
   {
+    char tmp[] = "unknown";
     lg = dvdnav_get_spu_logical_stream(nav, i);
     if(lg == 0xff) continue;
     lang = dvdnav_spu_stream_to_lang(nav, lg);
-    if(lang == 0xFFFF)
-      tmp[0] = tmp[1] = '?';
-    else
+    if(lang != 0xFFFF)
     {
       tmp[0] = lang >> 8;
       tmp[1] = lang & 0xFF;
+      tmp[2] = 0;
     }
-    tmp[2] = 0;
-    if (lang != 0xFFFF)
       mp_msg(MSGT_OPEN,MSGL_STATUS,MSGTR_DVDsubtitleLanguage, i, tmp);
   }
 }


More information about the MPlayer-cvslog mailing list