Fixed a possible crash when canceling VDR while displaying subtitles, and the primary device is no longer available

This commit is contained in:
Klaus Schmidinger 2012-02-12 15:45:59 +01:00
parent cace8bed8d
commit 1e74f596b2
3 changed files with 7 additions and 3 deletions

View File

@ -6855,3 +6855,5 @@ Video Disk Recorder Revision History
faster in case the file is very large (suggested by Helmut Auer).
- Fixed selecting the primary device for receiving the live viewing channel in
case it is bonded with an other device and has no receiver attached to it.
- Fixed a possible crash when canceling VDR while displaying subtitles, and the
primary device is no longer available.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: device.c 2.46 2012/01/18 10:43:00 kls Exp $
* $Id: device.c 2.47 2012/02/12 15:44:06 kls Exp $
*/
#include "device.h"
@ -41,7 +41,8 @@ cLiveSubtitle::~cLiveSubtitle()
void cLiveSubtitle::Receive(uchar *Data, int Length)
{
cDevice::PrimaryDevice()->PlayTs(Data, Length);
if (cDevice::PrimaryDevice())
cDevice::PrimaryDevice()->PlayTs(Data, Length);
}
// --- cDeviceHook -----------------------------------------------------------

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: dvbdevice.c 2.60 2012/02/12 12:38:49 kls Exp $
* $Id: dvbdevice.c 2.61 2012/02/12 15:45:10 kls Exp $
*/
#include "dvbdevice.h"
@ -1008,6 +1008,7 @@ cDvbDevice::cDvbDevice(int Adapter, int Frontend)
numModulations = 0;
bondedDevice = NULL;
needsDetachBondedReceivers = false;
tsBuffer = NULL;
// Devices that are present on all card types: