changeset 29130:33956c5f5005

Reemit the ID_AID_x_LANG for the track. This allows the identification of the audio track by language code (en or es) rather than by ID (128 or 129). patch by Kevin DeKorte, kdekorte gmail com
author diego
date Sat, 11 Apr 2009 13:51:02 +0000
parents fe379c71cb53
children df0f3be3c12f
files stream/stream_dvdnav.c
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream_dvdnav.c	Fri Apr 10 18:29:01 2009 +0000
+++ b/stream/stream_dvdnav.c	Sat Apr 11 13:51:02 2009 +0000
@@ -74,6 +74,7 @@
 };
 
 static int seek(stream_t *s, off_t newpos);
+static void show_audio_subs_languages(dvdnav_t *nav);
 
 static dvdnav_priv_t * new_dvdnav_stream(char * filename) {
   const char * title_str;
@@ -343,6 +344,7 @@
           priv->state &= ~NAV_FLAG_WAIT;
           s->end_pos = 0;
           update_title_len(s);
+          show_audio_subs_languages(priv->dvdnav);
           if (priv->state & NAV_FLAG_WAIT_READ_AUTO)
             priv->state |= NAV_FLAG_WAIT_READ;
           if(dvdnav_current_title_info(priv->dvdnav, &tit, &part) == DVDNAV_STATUS_OK) {
@@ -538,8 +540,12 @@
     if(format == 0xFFFF || format > 6)
       format = 1; //unknown
     id = i + base[format];
-    mp_msg(MSGT_OPEN,MSGL_STATUS,MSGTR_DVDaudioStreamInfo, i,
-      dvd_audio_stream_types[format], dvd_audio_stream_channels[channels], tmp, id); 
+    if (lang != 0xFFFF) {
+      mp_msg(MSGT_OPEN,MSGL_STATUS,MSGTR_DVDaudioStreamInfo, i,
+             dvd_audio_stream_types[format], dvd_audio_stream_channels[channels], tmp, id); 
+      if(lang && tmp[0])
+        mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AID_%d_LANG=%s\n", id, tmp);
+    }
   }
   
   for(i=0; i<32; i++)
@@ -555,7 +561,8 @@
       tmp[1] = lang & 0xFF;
     }
     tmp[2] = 0;
-    mp_msg(MSGT_OPEN,MSGL_STATUS,MSGTR_DVDsubtitleLanguage, i+0x20, tmp);
+    if (lang != 0xFFFF)
+      mp_msg(MSGT_OPEN,MSGL_STATUS,MSGTR_DVDsubtitleLanguage, i+0x20, tmp);
   }
 }