diff options
-rw-r--r-- | frontend.c | 21 |
1 files changed, 19 insertions, 2 deletions
@@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend.c,v 1.62 2008-09-18 18:11:35 phintuka Exp $ + * $Id: frontend.c,v 1.63 2008-09-23 21:49:35 phintuka Exp $ * */ @@ -212,7 +212,6 @@ void cXinelibThread::InfoHandler(const char *info) } else if(!strncmp(info, "DVDTITLE ", 9)) { - LOGMSG("%s", info); map += 9; while(*map == ' ') map++; cXinelibDevice::Instance().SetMetaInfo(miDvdTitleNo, map); @@ -777,6 +776,24 @@ bool cXinelibThread::PlayFile(const char *FileName, int Position, } else { if(xc.extsub_size >= 0) Xine_Control("EXTSUBSIZE", xc.extsub_size); + +#if VDRVERSNUM >= 10515 + // set preferred subtitle language + if (Setup.DisplaySubtitles) { + const char *langs = I18nLanguageCode(Setup.SubtitleLanguages[0]); + if (langs) { + char lang1[5]; + strn0cpy(lang1, langs, 4); /* truncate */ + const char *spu_lang = iso639_1_to_iso639_2(lang1); + LOGMSG("Preferred SPU language: %s (%s)", lang1, spu_lang); + if (spu_lang && spu_lang[0] && spu_lang[1] && !spu_lang[2]) + Xine_Control(cString::sprintf("SPUSTREAM %s", spu_lang)); + } + } else { + LOGMSG("Preferred SPU language: (none)"); + Xine_Control(cString::sprintf("SPUSTREAM %d", ttXSubtitleNone)); + } +#endif } return (!GetStopSignal()) && (result==0); |