Old subtitles not stopped when switching primary device

Message ID 489DF976.2030903@gmail.com
State New
Headers

Commit Message

Anssi Hannula Aug. 9, 2008, 8:09 p.m. UTC
  Hi!

When switching the primary device, old subtitles are not removed, and
user may get the subtitles of wrong channel or two sets of subtitles at
the same time.

Attached is a hacky patch that doesn't work if MakePrimaryDevice() is
implemented by a plugin device. Unfortunately I haven't currently got
the time to make a proper patch, but this should give you an idea on the
problem.
  

Patch

Index: vdr-1.6.0-primdev/device.c
===================================================================
--- vdr-1.6.0-primdev/device.c
+++ vdr-1.6.0-primdev/device.c	2008-05-23 22:17:05.000000000 +0300
@@ -313,6 +313,10 @@ 
 
 void cDevice::MakePrimaryDevice(bool On)
 {
+  if (On == false) {
+     DELETENULL(liveSubtitle);
+     DELETENULL(dvbSubtitleConverter);
+  }
 }
 
 bool cDevice::SetPrimaryDevice(int n)
Index: vdr-1.6.0-primdev/dvbdevice.c
===================================================================
--- vdr-1.6.0-primdev/dvbdevice.c
+++ vdr-1.6.0-primdev/dvbdevice.c	2008-05-23 22:18:03.000000000 +0300
@@ -486,6 +486,7 @@ 
 {
   if (On && HasDecoder())
      new cDvbOsdProvider(fd_osd);
+  cDevice::MakePrimaryDevice(On);
 }
 
 bool cDvbDevice::HasDecoder(void) const