Patch for DVB-subtitles plugin. Enable changes in subtitling during playback.

Message ID 4245FE8E.3080805@welho.com
State New
Headers

Commit Message

Petri Helin March 27, 2005, 12:30 a.m. UTC
  This small piece should allow the user to change the subtitles during 
playback if the recording contains several to choose from.

-Petri

----------------------------------------------------------------------------------------------------------------------------------------------------------------

     if (device != NULL && newChannel->GetId()==currentChannelId)
     {
        if (newChannel->GetUserLanguage() == USE_PREFERRED_LANGUAGES)
  

Comments

Darren Salt March 27, 2005, 12:40 p.m. UTC | #1
I demand that Petri Helin may or may not have written...

> This small piece should allow the user to change the subtitles during
> playback if the recording contains several to choose from.
[snip]

Your patch is broken: some lines have been wrapped, trailing spaces have been
removed, and tabs have been expanded. At least some of this is a consequence
of including it inline in a message which has format=flowed.

You should repost with your patch as an attachment.
  

Patch

--- subfilter_old.c     2005-03-27 01:40:50.341352400 +0200
+++ subfilter.c 2005-03-27 02:05:12.164121560 +0200
@@ -387,11 +387,32 @@ 
 void cSubtitlesChangedHandler::SubtitlingUpdate(const cSubtitleChannel* 
newChannel)
 {

-    if (!newChannel || primaryReplay || secondaryReplay)
+// don't quit on replay
+//    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) {
+      if (newChannel->GetUserLanguage() == 
gSubtitlesConfiguration.language) {
+          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);
+      }
+    }
+
+