From patchwork Wed Sep 14 15:19:47 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Petri Helin X-Patchwork-Id: 12023 Received: from smtp1.pp.htv.fi ([213.243.153.37]) by www.linuxtv.org with esmtp (Exim 4.34) id 1EFZ10-0003YE-W7 for vdr@linuxtv.org; Wed, 14 Sep 2005 17:17:39 +0200 Received: from [192.168.1.100] (cs181062103.pp.htv.fi [82.181.62.103]) by smtp1.pp.htv.fi (Postfix) with ESMTP id 185437FC9F for ; Wed, 14 Sep 2005 18:17:38 +0300 (EEST) Message-ID: <43283F93.7080207@welho.com> Date: Wed, 14 Sep 2005 18:19:47 +0300 From: Petri Helin User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050322) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Klaus Schmidinger's VDR Subject: Re: [vdr] [subtitles-plugin] Is it possible to change the PIDS in a recording on the fly? References: <43281A49.7070206@welho.com> <20050914171527.5ba429d0.nm@phnet.fi> <20050914143030.GC3928@localhost.localdomain> In-Reply-To: <20050914143030.GC3928@localhost.localdomain> X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Sep 2005 15:17:39 -0000 Status: O X-Status: X-Keywords: X-UID: 4955 On Wed, Sep 14, 2005 at 05:15:27PM +0300, Niko Mikkila wrote: >>On Wed, 14 Sep 2005 15:40:41 +0300 >>Petri Helin wrote: >> >> >>>I have been trying to modify the subtitles plugin to cope with the >>>dynamic subtitling currently in use in Finland. But with no luck so far. >>>I can record the subtitles if the stream with the right PID is already >>>present when the recording starts, but not if the recording starts too >>>early. >>> >>> >>How does this come up in practice? Personally, I have never missed finnish >>subtitles, or at least not for the tens of programs recorded this summer. >>I don't know about subtitle streams for other languages though. >> >> Do you mean the dynamic subtitling? I think that the solution YLE is using goes like this: - you have a fixed PID with every possible language for every channel, for example on TV1 finnish is 1027, swedish 1028, on YLE Teema finnish is 4027, swedish is 4028, spanish is 4031 and french is... can't remember now - the finnish stream is always present(?) and others only during the program that has subtitles for that language => This means that if you have finnish selected either as first or second subtitling language, it will be always present in the recording. But since you cannot select more than two subtitling languages, that doesn't cover all the possibilities. I like to use the subtitles on the same language as the audio is, if that is possible (like to keep up those language skills;). YLE Teema sends couple of programs that have subtitling other than finnish or swedish. Marko Mäkelä wrote: >Me neither. There's a known issue that you cannot select the subtitle >language while watching a recording. I recorded one short series from >YLE FST that had both Finnish and Swedish subtitles. When I start >watching the recordings from a random position, I sometimes get Swedish >and sometimes Finnish subtitles. Both are present in the recording, >perhaps because I have included both languages in the configuration. > > Actually I have created a crude hack that enables the changing of subtitles during replay. Attached is a version for subtitles plugin 0.3.8. Please try that one and tell me if it is of any help. --- subtitles-0.3.8-vanilla/subfilter.c 2005-08-22 20:01:04.000000000 +0300 +++ subtitles-0.3.8/subfilter.c 2005-08-22 20:31:55.000000000 +0300 @@ -284,6 +284,7 @@ { private: tChannelID currentChannelId; + int isReplaying; cSubtitlesReceiver *selectedReceiver; cSubtitlesReceiver *primaryReceiver; @@ -317,6 +318,7 @@ primaryReplay = NULL; secondaryReplay = NULL; device = Device; + isReplaying = 0; } cSubtitlesChangedHandler::~cSubtitlesChangedHandler() @@ -345,12 +347,14 @@ primaryReplay = new cDvbSubtitlesReplay(1000,0x28); secondaryReplay = new cDvbSubtitlesReplay(900,0x29); + isReplaying = 1; } else { // replaying stops DELETENULL(primaryReplay); DELETENULL(secondaryReplay); + isReplaying = 0; } } @@ -387,11 +391,33 @@ void cSubtitlesChangedHandler::SubtitlingUpdate(const cSubtitleChannel* newChannel) { - if (!newChannel || primaryReplay || secondaryReplay) + if (!newChannel) return; cMutexLock lock(&mutex); +// Added this if-block to allow user to change the subtitles during replay + if (primaryReplay || secondaryReplay || isReplaying) + { + if (newChannel->GetUserLanguage() == gSubtitlesConfiguration.language || newChannel->GetUserLanguage() == -1) + { + DELETENULL(primaryReplay); + DELETENULL(secondaryReplay); + primaryReplay = new cDvbSubtitlesReplay(900,0x28); + } + else if (newChannel->GetUserLanguage() == gSubtitlesConfiguration.language2) { + DELETENULL(primaryReplay); + DELETENULL(secondaryReplay); + secondaryReplay = new cDvbSubtitlesReplay(1000,0x29); + } + else + { + DELETENULL(primaryReplay); + DELETENULL(secondaryReplay); + } + return; + } + if (device != NULL && newChannel->GetId()==currentChannelId) { if (newChannel->GetUserLanguage() == USE_PREFERRED_LANGUAGES) @@ -648,6 +674,8 @@ asprintf(&titlebuf, "%s - %s", channel->Name(), tr("Choose Language")); cOsdMenu::SetTitle(titlebuf); free(titlebuf); + // This should be changed so that it knows when replaying + // and won't use last tuned channel as base for sub information channelId = channel->GetChannelID(); Setup(); @@ -682,7 +710,7 @@ const tSubtitleStream* stream; stream = schannel->GetByLanguage(i); - if (stream != NULL || showAll) + if (stream != NULL || showAll || i==gSubtitlesConfiguration.language || i==gSubtitlesConfiguration.language2) { Add(new cLanguageItem(languages[i],i), userLanguage == i); }