show both language codes / languages when two language codes are transmitted for...
authorghost <andreas.monzner@multimedia-labs.de>
Mon, 11 May 2009 09:42:51 +0000 (11:42 +0200)
committerghost <andreas.monzner@multimedia-labs.de>
Mon, 11 May 2009 09:42:51 +0000 (11:42 +0200)
lib/dvb/pmt.cpp
lib/python/Screens/InfoBarGenerics.py

index 0198c8f75b3a711e5eb94b8ff887f09608b8f96f..da45c8eb4733f95e290d3876424f384172308b13 100644 (file)
@@ -399,10 +399,16 @@ int eDVBServicePMTHandler::getProgramInfo(struct program &program)
                                                                case ISO_639_LANGUAGE_DESCRIPTOR:
                                                                        if (!isvideo)
                                                                        {
+                                                                               int cnt=0;
                                                                                const Iso639LanguageList *languages = ((Iso639LanguageDescriptor*)*desc)->getIso639Languages();
                                                                                        /* use last language code */
-                                                                               for (Iso639LanguageConstIterator i(languages->begin()); i != languages->end(); ++i)
-                                                                                       audio.language_code = (*i)->getIso639LanguageCode();
+                                                                               for (Iso639LanguageConstIterator i(languages->begin()); i != languages->end(); ++i, ++cnt)
+                                                                               {
+                                                                                       if (cnt == 0)
+                                                                                               audio.language_code = (*i)->getIso639LanguageCode();
+                                                                                       else
+                                                                                               audio.language_code += "/" + (*i)->getIso639LanguageCode();
+                                                                               }
                                                                        }
                                                                        break;
                                                                case STREAM_IDENTIFIER_DESCRIPTOR:
index c161818451d6a7ab0f48f29ddf7264243d86af3d..9adaa6db1caeb0da93c6fdee2c90f14dfc5eb158 100644 (file)
@@ -1631,12 +1631,20 @@ class InfoBarAudioSelection:
 
                        idx = 0
                        while idx < n:
+                               cnt = 0
                                i = audio.getTrackInfo(idx)
-                               language = i.getLanguage()
+                               languages = i.getLanguage().split('/')
                                description = i.getDescription()
+                               language = ""
 
-                               if LanguageCodes.has_key(language):
-                                       language = LanguageCodes[language][0]
+                               for lang in languages:
+                                       if cnt:
+                                               language += ' / '
+                                       if LanguageCodes.has_key(lang):
+                                               language += LanguageCodes[lang][0]
+                                       else:
+                                               language += lang
+                                       cnt += 1
 
                                if len(description):
                                        description += " (" + language + ")"