diff options
-rw-r--r-- | CONTRIBUTORS | 2 | ||||
-rw-r--r-- | HISTORY | 6 | ||||
-rw-r--r-- | dvbplayer.c | 3 | ||||
-rw-r--r-- | player.h | 10 |
4 files changed, 14 insertions, 7 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 6ea191ea..7698d7b5 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2840,6 +2840,8 @@ Johann Friedrichs <johann.friedrichs@web.de> for fixing handling VPS events outside the LingerLimit, which could cause recordings to stop prematurely 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> for reporting a hangup when replaying a TS recording with subtitles activated @@ -9162,7 +9162,7 @@ Video Disk Recorder Revision History a subdirectory. - 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 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). - Fixed handling timers during the change from DST to winter time (thanks to Johann 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). diff --git a/dvbplayer.c b/dvbplayer.c index ca007353..d1c02f9f 100644 --- a/dvbplayer.c +++ b/dvbplayer.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * 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" @@ -1003,6 +1003,7 @@ bool cDvbPlayerControl::Active(void) void cDvbPlayerControl::Stop(void) { + cControl::player = NULL; delete player; player = NULL; } @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * 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 @@ -102,10 +102,10 @@ public: ///< 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 ///< string. The default implementation returns an empty string. - double FramesPerSecond(void) const { return player->FramesPerSecond(); } - bool GetIndex(int &Current, int &Total, bool SnapToIFrame = false) const { return player->GetIndex(Current, Total, SnapToIFrame); } - bool GetFrameNumber(int &Current, int &Total) const { return player->GetFrameNumber(Current, Total); } - bool GetReplayMode(bool &Play, bool &Forward, int &Speed) const { return player->GetReplayMode(Play, Forward, Speed); } + double FramesPerSecond(void) const { return player ? player->FramesPerSecond() : DEFAULTFRAMESPERSECOND; } + 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 ? player->GetFrameNumber(Current, Total) : false; } + bool GetReplayMode(bool &Play, bool &Forward, int &Speed) const { return player ? player->GetReplayMode(Play, Forward, Speed) : false; } static void Launch(cControl *Control); static void Attach(void); static void Shutdown(void); |