[vlc-devel] commit: Use sub-language as DVD menu (close #1994) (Laurent Aimar )

git version control git at videolan.org
Fri Sep 5 21:36:12 CEST 2008


vlc | branch: 0.9-bugfix | Laurent Aimar <fenrir at videolan.org> | Fri Sep  5 21:30:22 2008 +0200| [a3974c220fbb1ed5f21626442413203103acf9b0] | committer: Jean-Baptiste Kempf 

Use sub-language as DVD menu (close #1994)
(cherry picked from commit 2221f03d0371243813a252a4613bd62d81a656ce)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a3974c220fbb1ed5f21626442413203103acf9b0
---

 modules/access/dvdnav.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c
index 2ccc903..e856b91 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -256,15 +256,19 @@ static int Open( vlc_object_t *p_this )
         msg_Warn( p_demux, "cannot set PGC positioning flag" );
     }
 
-    /* Set menu language ("en")
-     * XXX: maybe it would be better to set it like audio/spu
-     * or to create a --menu-language option */
-    if( dvdnav_menu_language_select( p_sys->dvdnav, (char*)LANGUAGE_DEFAULT ) !=
+    /* Set menu language
+     * XXX A menu-language may be better than sub-language */
+    psz_code = DemuxGetLanguageCode( p_demux, "sub-language" );
+    if( dvdnav_menu_language_select( p_sys->dvdnav, psz_code ) !=
         DVDNAV_STATUS_OK )
     {
         msg_Warn( p_demux, "can't set menu language to '%s' (%s)",
-                  LANGUAGE_DEFAULT, dvdnav_err_to_string( p_sys->dvdnav ) );
+                  psz_code, dvdnav_err_to_string( p_sys->dvdnav ) );
+        /* We try to fall back to 'en' */
+        if( strcmp( psz_code, LANGUAGE_DEFAULT ) )
+            dvdnav_menu_language_select( p_sys->dvdnav, (char*)LANGUAGE_DEFAULT );
     }
+    free( psz_code );
 
     /* Set audio language */
     psz_code = DemuxGetLanguageCode( p_demux, "audio-language" );




More information about the vlc-devel mailing list