From patchwork Fri Mar 7 15:43:11 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Schmidinger X-Patchwork-Id: 12625 Received: from raven.cadsoft.de ([217.7.101.211]) by www.linuxtv.org with esmtp (Exim 4.63) (envelope-from ) id 1JXej6-0002wx-Fl for vdr@linuxtv.org; Fri, 07 Mar 2008 16:43:20 +0100 Received: from [192.168.100.10] (hawk.cadsoft.de [192.168.100.10]) by raven.cadsoft.de (8.13.3/8.13.3) with ESMTP id m27FhBV7003833 for ; Fri, 7 Mar 2008 16:43:11 +0100 Message-ID: <47D1628F.5040600@cadsoft.de> Date: Fri, 07 Mar 2008 16:43:11 +0100 From: Klaus Schmidinger Organization: CadSoft Computer GmbH User-Agent: Thunderbird 2.0.0.9 (X11/20070801) MIME-Version: 1.0 To: vdr@linuxtv.org References: <6473954D-6A29-4913-9E4D-0F64C6FF9669@dnainternet.net> <47CDA03D.7000305@cadsoft.de> <47CDAE49.6030706@googlemail.com> <47D07212.3030003@cadsoft.de> In-Reply-To: X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (raven.cadsoft.de [192.168.1.1]); Fri, 07 Mar 2008 16:43:12 +0100 (CET) X-LSpam-Score: 0.0 (/) Subject: Re: [vdr] Hearing-impaired DVB subtitles X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.9 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2008 15:43:21 -0000 Status: O X-Status: X-Keywords: X-UID: 16024 On 03/07/08 12:26, Rolf Ahrenberg wrote: > On Thu, 6 Mar 2008, Klaus Schmidinger wrote: > >> None of these two is specified as "for the hard of hearing". > > Well, as Jouni already told, the Dutch is used here on YLE channels for > hard of hearing purposes. :) > >> Maybe this is what's causing the problems here. While this makes sense for >> audio, it might not be that useful for subtitles. I guess some change in >> cDevice::EnsureSubtitleTrack() needs to be done to fix this. > > I guess this kind of small change would be enough. IMO, the subtitles > should be shown only if a preferred language matches. > > --- device.c.orig 2008-03-07 13:18:09.000000000 +0200 > +++ device.c 2008-03-07 13:18:49.000000000 +0200 > @@ -1096,7 +1096,7 @@ > void cDevice::EnsureSubtitleTrack(void) > { > if (Setup.DisplaySubtitles) { > - eTrackType PreferredTrack = ttSubtitleFirst; > + eTrackType PreferredTrack = ttNone; > int LanguagePreference = -1; > for (int i = ttSubtitleFirst; i <= ttSubtitleLast; i++) { > const tTrackId *TrackId = GetTrack(eTrackType(i)); Actually I believe we also need to initialize LanguagePreference to a "high value". The full patch I'll add for version 1.6.0 is this: With this, if I set the preferred subtitle language to Finnish (suomi), Petri's example works as expected: the narrator is not subtitled, while the woman is. Please verify and let me know if this works for you, too - and doesn't break anything else. Klaus --- device.c 2008/02/23 13:09:01 1.155 +++ device.c 2008/03/07 15:26:23 @@ -1096,8 +1096,8 @@ void cDevice::EnsureSubtitleTrack(void) { if (Setup.DisplaySubtitles) { - eTrackType PreferredTrack = ttSubtitleFirst; - int LanguagePreference = -1; + eTrackType PreferredTrack = ttNone; + 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))