Watching old recordings with DVB subtitles with 1.6.0
Commit Message
Petri Helin wrote:
> Rolf Ahrenberg wrote:
>> On Sat, 12 Apr 2008, Ville Skyttä wrote:
>>
>>> After figuring out how to access the subtitles menu (my remote.conf was from
>>> 1.4.x series so there was no button binding for it), yes, I do see an entry
>>> named "57" there. Selecting it gives me the Finnish subtitles I was looking
>>> for. Thanks for the tip.
>> You could also map "57" to "fin" in info.vdr of all those old recordings
>> and afterwards VDR automatically selects subtitles according to
>> preferred languages.
>>
>
> Is "57" dependent on the in subtitling language, or is it constant for
> all old recordings?
It is constant. 57 is for the first subtitle track, 58 for the second.
> If it is constant, could VDR be patched easily to
> select "57" in case preferred subtitles are not found?
Yes. Patch attached.
===================================================================
@@ -1100,7 +1100,9 @@
int LanguagePreference = INT_MAX; // higher than the maximum possible value
for (int i = ttSubtitleFirst; i <= ttSubtitleLast; i++) {
const tTrackId *TrackId = GetTrack(eTrackType(i));
- if (TrackId && TrackId->id && I18nIsPreferredLanguage(Setup.SubtitleLanguages, TrackId->language, LanguagePreference))
+ // Fall back to languageless ttSubtitleFirst+8 track created by old subtitles patch if present
+ if (TrackId && TrackId->id && (I18nIsPreferredLanguage(Setup.SubtitleLanguages, TrackId->language, LanguagePreference)
+ || ((i == ttSubtitleFirst + 8) && !(*TrackId->language) && LanguagePreference == INT_MAX)))
PreferredTrack = eTrackType(i);
}
// Make sure we're set to an available subtitle track: