summaryrefslogtreecommitdiff
path: root/player.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2020-05-18 16:47:29 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2020-05-18 16:47:29 +0200
commit196785ff054a3236747ac8ad0302300c052d377a (patch)
tree12c4559386bc990b9e64804e80268f3387e5899d /player.h
parentdd9dd76722fac5902b9237d836bb1b7bce9bcbae (diff)
downloadvdr-196785ff054a3236747ac8ad0302300c052d377a.tar.gz
vdr-196785ff054a3236747ac8ad0302300c052d377a.tar.bz2
Fixed a possible crash in case replay is started and stopped in rapid sequence2.4.2
Diffstat (limited to 'player.h')
-rw-r--r--player.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/player.h b/player.h
index d67bf2a9..22c748bd 100644
--- a/player.h
+++ b/player.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: player.h 4.4 2018/02/01 15:34:51 kls Exp $
+ * $Id: player.h 4.5 2020/05/18 16:47:29 kls Exp $
*/
#ifndef __PLAYER_H
@@ -114,10 +114,21 @@ public:
static void Launch(cControl *Control);
static void Attach(void);
static void Shutdown(void);
+#define DEPRECATED_CCONTROL 1
+#if DEPRECATED_CCONTROL
static cControl *Control(bool Hidden = false);
+ ///< Old version of this function, for backwards compatibility with plugins.
+ ///< Plugins should be changed to use the new version below, which does
+ ///< proper locking.
+ ///< Use of this function may result in program crashes in case replay is
+ ///< stopped immediately after starting it.
+#endif
+ static cControl *Control(cMutexLock &MutexLock, bool Hidden = false);
///< Returns the current replay control (if any) in case it is currently
///< visible. If Hidden is true, the control will be returned even if it is
///< currently hidden.
+ ///< The given MutexLock must live as long as the replay control is accessed,
+ ///< and must go out of scope as soon as the control is no longer accessed.
};
#endif //__PLAYER_H