1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed a possible crash with plugins that retrieve player information after a replay has been stopped, but before the replay control has been destroyed

This commit is contained in:
Klaus Schmidinger 2017-11-26 15:02:54 +01:00
parent 8dcff164fa
commit a9d82331e6
4 changed files with 14 additions and 7 deletions

View File

@ -2840,6 +2840,8 @@ Johann Friedrichs <johann.friedrichs@web.de>
for fixing handling VPS events outside the LingerLimit, which could cause recordings to for fixing handling VPS events outside the LingerLimit, which could cause recordings to
stop prematurely stop prematurely
for fixing handling timers during the change from DST to winter time for fixing handling timers during the change from DST to winter time
for fixing a possible crash with plugins that retrieve player information after a
replay has been stopped, but before the replay control has been destroyed
Timo Helkio <timolavi@mbnet.fi> Timo Helkio <timolavi@mbnet.fi>
for reporting a hangup when replaying a TS recording with subtitles activated for reporting a hangup when replaying a TS recording with subtitles activated

View File

@ -9162,7 +9162,7 @@ Video Disk Recorder Revision History
a subdirectory. a subdirectory.
- SVDRP peering can now be limited to the default SVDRP host (see MANUAL for details). - SVDRP peering can now be limited to the default SVDRP host (see MANUAL for details).
2017-11-12: Version 2.3.9 2017-11-26: Version 2.3.9
- Updated the Italian OSD texts (thanks to Diego Pierotto). - Updated the Italian OSD texts (thanks to Diego Pierotto).
- Updated the Finnish OSD texts (thanks to Rolf Ahrenberg). - Updated the Finnish OSD texts (thanks to Rolf Ahrenberg).
@ -9201,3 +9201,7 @@ Video Disk Recorder Revision History
- Added some comments regarding font height (thanks to Thomas Reufer). - Added some comments regarding font height (thanks to Thomas Reufer).
- Fixed handling timers during the change from DST to winter time (thanks to Johann - Fixed handling timers during the change from DST to winter time (thanks to Johann
Friedrichs). Friedrichs).
- Added missing checks of 'player' in member functions of cControl, and setting
cControl::player to NULL in cDvbPlayerControl::Stop() to avoid a possible crash
with plugins that retrieve player information after a replay has been stopped, but
before the replay control has been destroyed (thanks to Johann Friedrich).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: dvbplayer.c 4.4 2016/12/22 11:34:31 kls Exp $ * $Id: dvbplayer.c 4.5 2017/11/26 14:55:03 kls Exp $
*/ */
#include "dvbplayer.h" #include "dvbplayer.h"
@ -1003,6 +1003,7 @@ bool cDvbPlayerControl::Active(void)
void cDvbPlayerControl::Stop(void) void cDvbPlayerControl::Stop(void)
{ {
cControl::player = NULL;
delete player; delete player;
player = NULL; player = NULL;
} }

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: player.h 4.2 2016/12/22 10:38:11 kls Exp $ * $Id: player.h 4.3 2017/11/26 14:29:12 kls Exp $
*/ */
#ifndef __PLAYER_H #ifndef __PLAYER_H
@ -102,10 +102,10 @@ public:
///< skins as a last resort, in case they want to display the state of the ///< skins as a last resort, in case they want to display the state of the
///< current player. The return value is expected to be a short, single line ///< current player. The return value is expected to be a short, single line
///< string. The default implementation returns an empty string. ///< string. The default implementation returns an empty string.
double FramesPerSecond(void) const { return player->FramesPerSecond(); } double FramesPerSecond(void) const { return player ? player->FramesPerSecond() : DEFAULTFRAMESPERSECOND; }
bool GetIndex(int &Current, int &Total, bool SnapToIFrame = false) const { return player->GetIndex(Current, Total, SnapToIFrame); } bool GetIndex(int &Current, int &Total, bool SnapToIFrame = false) const { return player ? player->GetIndex(Current, Total, SnapToIFrame) : false; }
bool GetFrameNumber(int &Current, int &Total) const { return player->GetFrameNumber(Current, Total); } bool GetFrameNumber(int &Current, int &Total) const { return player ? player->GetFrameNumber(Current, Total) : false; }
bool GetReplayMode(bool &Play, bool &Forward, int &Speed) const { return player->GetReplayMode(Play, Forward, Speed); } bool GetReplayMode(bool &Play, bool &Forward, int &Speed) const { return player ? player->GetReplayMode(Play, Forward, Speed) : false; }
static void Launch(cControl *Control); static void Launch(cControl *Control);
static void Attach(void); static void Attach(void);
static void Shutdown(void); static void Shutdown(void);