[vlc-devel] commit: Fixed audio/spu language selection when none specified in dvdnav. ( Laurent Aimar )

git version control git at videolan.org
Sun Sep 21 04:23:45 CEST 2008


vlc | branch: 0.9-bugfix | Laurent Aimar <fenrir at videolan.org> | Fri Sep 19 21:57:40 2008 +0200| [40b0764d484c0602176d85ca94c248787502079f] | committer: Jean-Baptiste Kempf 

Fixed audio/spu language selection when none specified in dvdnav.
(cherry picked from commit aef002579e802838cf850bec6f62a387c42a3185)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/access/dvdnav.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c
index e856b91..6538f94 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -859,12 +859,18 @@ static char *DemuxGetLanguageCode( demux_t *p_demux, const char *psz_var )
     char *p;
 
     psz_lang = var_CreateGetString( p_demux, psz_var );
+    if( !psz_lang )
+        return strdup(LANGUAGE_DEFAULT);
+
     /* XXX: we will use only the first value
      * (and ignore other ones in case of a list) */
-    if( ( p = strchr( psz_lang, ',' ) ) ) *p = '\0';
+    if( ( p = strchr( psz_lang, ',' ) ) )
+        *p = '\0';
 
     for( pl = p_languages; pl->psz_iso639_1 != NULL; pl++ )
     {
+        if( *psz_lang == '\0' )
+            continue;
         if( !strcasecmp( pl->psz_eng_name, psz_lang ) ||
             !strcasecmp( pl->psz_native_name, psz_lang ) ||
             !strcasecmp( pl->psz_iso639_1, psz_lang ) ||




More information about the vlc-devel mailing list