diff --git "a/C:\\Users\\JBLOMB~1.WGA\\AppData\\Local\\Temp\\SubE8A9.tmp\\SubtitleSelector-b01665-left.cs" "b/C:\\Projects\\Mediaportal\\mediaportal\\Core\\Player\\Subtitles\\SubtitleSelector.cs" index ff16cbf..702d0f6 100644 --- "a/C:\\Users\\JBLOMB~1.WGA\\AppData\\Local\\Temp\\SubE8A9.tmp\\SubtitleSelector-b01665-left.cs" +++ "b/C:\\Projects\\Mediaportal\\mediaportal\\Core\\Player\\Subtitles\\SubtitleSelector.cs" @@ -322,20 +322,40 @@ namespace MediaPortal.Player.Subtitles SubtitleOption prefered = null; int priority = int.MaxValue; int prefOptIndex = -1; - + int prefPage = 0; + try + { + using (MPSettings xmlreader = new MPSettings()) + { + // get the currently found active subtitle page set by TeletextReceiver + string defSub = xmlreader.GetValueAsString("tvservice", "dvbdefttxtsubtitles", "999;999"); + prefPage = Convert.ToInt16(defSub.Split(';')[0]); + } + } + catch { } for (int optIndex = 1; optIndex < options.Count; optIndex++) { SubtitleOption opt = options[optIndex]; int index = preferedLanguages.IndexOf(opt.language); Log.Debug(opt + " Pref index " + index); - if (index >= 0 && index < priority) + bool pref = false; + if (opt.type == SubtitleType.Bitmap) { - Log.Debug("Setting as pref"); - prefered = opt; - priority = index; - prefOptIndex = optIndex; + if (index >= 0 && index < priority) pref = true; } + else + { + if (prefPage == opt.entry.page) pref = true; + } + if (pref) + { + Log.Debug("Setting as pref"); + prefered = opt; + priority = index; + prefOptIndex = optIndex; + } + } return prefered; }