From 491c6d0a859c98b7da69b5b4a01be0133fdfdc1c Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Fri, 1 Jan 2010 15:15:36 +0100 Subject: [PATCH] Fixed stopping subtitle display when switching the primary device --- CONTRIBUTORS | 1 + HISTORY | 5 +++++ PLUGINS/src/dvbsddevice/HISTORY | 5 +++++ PLUGINS/src/dvbsddevice/dvbsddevice.c | 4 ++-- PLUGINS/src/dvbsddevice/dvbsdffdevice.c | 3 ++- device.c | 6 +++++- device.h | 4 +++- 7 files changed, 23 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index d4855e11..4d6bcd4d 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2255,6 +2255,7 @@ Anssi Hannula for suggesting to change the default for LOCDIR in Makefile and Make.config.template to "./locale", so that internationalization works by default when running VDR from within its source directory + for fixing stopping subtitle display when switching the primary device Antti Hartikainen for updating 'S13E' in 'sources.conf' diff --git a/HISTORY b/HISTORY index 096cb488..a1f647da 100644 --- a/HISTORY +++ b/HISTORY @@ -6242,3 +6242,8 @@ Video Disk Recorder Revision History capability. - Fixed handling the "CA PMT" generation (revised a change not mentioned in version 1.7.9's changes, which caused a malfunction with Conax and Viaccess CAMs). +- Fixed stopping subtitle display when switching the primary device (thanks to + Anssi Hannula). + IMPORTANT NOTE TO PLUGIN AUTHORS: a plugin that implements a derived cDevice + class that can replay video must now call the MakePrimaryDevice() function of + its base class. diff --git a/PLUGINS/src/dvbsddevice/HISTORY b/PLUGINS/src/dvbsddevice/HISTORY index 96157d5e..d2b0f1f6 100644 --- a/PLUGINS/src/dvbsddevice/HISTORY +++ b/PLUGINS/src/dvbsddevice/HISTORY @@ -4,3 +4,8 @@ VDR Plugin 'dvbsddevice' Revision History 2009-12-28: Version 0.0.1 - Initial revision. + +2010-01-01: Version 0.0.2 + +- Calling the MakePrimaryDevice() function of the base class to allow + the cDevice to stop displaying subtitles. diff --git a/PLUGINS/src/dvbsddevice/dvbsddevice.c b/PLUGINS/src/dvbsddevice/dvbsddevice.c index 52317f88..e2248e9b 100644 --- a/PLUGINS/src/dvbsddevice/dvbsddevice.c +++ b/PLUGINS/src/dvbsddevice/dvbsddevice.c @@ -3,13 +3,13 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: dvbsddevice.c 1.1 2009/12/31 15:36:00 kls Exp $ + * $Id: dvbsddevice.c 1.2 2010/01/01 15:01:01 kls Exp $ */ #include #include "dvbsdffdevice.h" -static const char *VERSION = "0.0.1"; +static const char *VERSION = "0.0.2"; static const char *DESCRIPTION = "SD Full Featured DVB device"; class cPluginDvbsddevice : public cPlugin { diff --git a/PLUGINS/src/dvbsddevice/dvbsdffdevice.c b/PLUGINS/src/dvbsddevice/dvbsdffdevice.c index 797bfd33..61913776 100644 --- a/PLUGINS/src/dvbsddevice/dvbsdffdevice.c +++ b/PLUGINS/src/dvbsddevice/dvbsdffdevice.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: dvbsdffdevice.c 2.23 2009/12/31 15:36:56 kls Exp $ + * $Id: dvbsdffdevice.c 2.24 2010/01/01 15:03:02 kls Exp $ */ #include "dvbsdffdevice.h" @@ -82,6 +82,7 @@ void cDvbSdFfDevice::MakePrimaryDevice(bool On) { if (On) new cDvbOsdProvider(fd_osd); + cDvbDevice::MakePrimaryDevice(On); } bool cDvbSdFfDevice::HasDecoder(void) const diff --git a/device.c b/device.c index 527946ee..481d2328 100644 --- a/device.c +++ b/device.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.c 2.29 2009/12/25 15:24:02 kls Exp $ + * $Id: device.c 2.30 2010/01/01 15:03:36 kls Exp $ */ #include "device.h" @@ -154,6 +154,10 @@ int cDevice::DeviceNumber(void) const void cDevice::MakePrimaryDevice(bool On) { + if (!On) { + DELETENULL(liveSubtitle); + DELETENULL(dvbSubtitleConverter); + } } bool cDevice::SetPrimaryDevice(int n) diff --git a/device.h b/device.h index f1b63488..897de2af 100644 --- a/device.h +++ b/device.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.h 2.18 2009/12/25 15:09:18 kls Exp $ + * $Id: device.h 2.19 2010/01/01 15:04:27 kls Exp $ */ #ifndef __DEVICE_H @@ -176,6 +176,8 @@ protected: ///< anything the device needs to set up when it becomes the primary ///< device (On = true) or to shut down when it no longer is the primary ///< device (On = false), it should do so in this function. + ///< A derived class must call the MakePrimaryDevice() function of its + ///< base class. public: bool IsPrimaryDevice(void) const { return this == primaryDevice; } int CardIndex(void) const { return cardIndex; }