1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed automatically selecting the preferred subtitle language

This commit is contained in:
Klaus Schmidinger 2008-03-07 15:44:52 +01:00
parent 21e7de9ec5
commit 8bfee7a1b4
3 changed files with 8 additions and 4 deletions

View File

@ -1046,6 +1046,8 @@ Rolf Ahrenberg <rahrenbe@cc.hut.fi>
SVDRP in case VDR is run with --vfat, in order to avoid names that are too long SVDRP in case VDR is run with --vfat, in order to avoid names that are too long
for Windows for Windows
for increasing the valid range of the "Subtitle offset" setup option to -100...100 for increasing the valid range of the "Subtitle offset" setup option to -100...100
for a patch that was used to fix automatically selecting the preferred subtitle
language
Ralf Klueber <ralf.klueber@vodafone.com> Ralf Klueber <ralf.klueber@vodafone.com>
for reporting a bug in cutting a recording if there is only a single editing mark for reporting a bug in cutting a recording if there is only a single editing mark

View File

@ -5694,7 +5694,7 @@ Video Disk Recorder Revision History
standard ETSI EN 300 468) to ISO-8859-9, in order to work around the stupidity of standard ETSI EN 300 468) to ISO-8859-9, in order to work around the stupidity of
some providers, who actually use ISO-8859-9, but fail to correctly announce that. some providers, who actually use ISO-8859-9, but fail to correctly announce that.
2008-03-05: Version 1.5.18 2008-03-07: Version 1.5.18
- Added a missing reset of maxNumber in cChannels::Renumber() (reported by Sundararaj - Added a missing reset of maxNumber in cChannels::Renumber() (reported by Sundararaj
Reel). Reel).
@ -5706,3 +5706,5 @@ Video Disk Recorder Revision History
- Fixed a signed character used as index in cBase64Encoder::NextLine() (thanks - Fixed a signed character used as index in cBase64Encoder::NextLine() (thanks
to Tobias Grimm). to Tobias Grimm).
- Updated the Spanish and Catalanian OSD texts (thanks to Luca Olivetti). - Updated the Spanish and Catalanian OSD texts (thanks to Luca Olivetti).
- Fixed automatically selecting the preferred subtitle language (based on a patch
from Rolf Ahrenberg).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: device.c 1.155 2008/02/23 13:09:01 kls Exp $ * $Id: device.c 1.156 2008/03/07 15:36:25 kls Exp $
*/ */
#include "device.h" #include "device.h"
@ -1096,8 +1096,8 @@ void cDevice::EnsureAudioTrack(bool Force)
void cDevice::EnsureSubtitleTrack(void) void cDevice::EnsureSubtitleTrack(void)
{ {
if (Setup.DisplaySubtitles) { if (Setup.DisplaySubtitles) {
eTrackType PreferredTrack = ttSubtitleFirst; eTrackType PreferredTrack = ttNone;
int LanguagePreference = -1; int LanguagePreference = INT_MAX; // higher than the maximum possible value
for (int i = ttSubtitleFirst; i <= ttSubtitleLast; i++) { for (int i = ttSubtitleFirst; i <= ttSubtitleLast; i++) {
const tTrackId *TrackId = GetTrack(eTrackType(i)); const tTrackId *TrackId = GetTrack(eTrackType(i));
if (TrackId && TrackId->id && I18nIsPreferredLanguage(Setup.SubtitleLanguages, TrackId->language, LanguagePreference)) if (TrackId && TrackId->id && I18nIsPreferredLanguage(Setup.SubtitleLanguages, TrackId->language, LanguagePreference))