summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2011-08-15 09:37:54 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2011-08-15 09:37:54 +0200
commitfc4bed511d1ab6faedffedd34846198b5955c5fd (patch)
tree8ece0dcfba70cf68535d5c7d555da6931bf7e450
parentc13d6e6070d895dd33f82e80b5d045cbb417bc6c (diff)
downloadvdr-fc4bed511d1ab6faedffedd34846198b5955c5fd.tar.gz
vdr-fc4bed511d1ab6faedffedd34846198b5955c5fd.tar.bz2
Added a mutex to protect cOsd::Osds from simultaneous access from different threads
-rw-r--r--CONTRIBUTORS1
-rw-r--r--HISTORY4
-rw-r--r--osd.c6
-rw-r--r--osd.h3
4 files changed, 11 insertions, 3 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index eb47d58b..ce8335e8 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -1109,6 +1109,7 @@ Rolf Ahrenberg <rahrenbe@cc.hut.fi>
for some input on how to use BER and UNC values to generate a "quality" value
for fixing some crashes in subtitle display
for reporting that DELETENULL() was not thread safe
+ for reporting a crash in subtitle display, related to cOsd::Osds
Ralf Klueber <ralf.klueber@vodafone.com>
for reporting a bug in cutting a recording if there is only a single editing mark
diff --git a/HISTORY b/HISTORY
index f1af119c..545f9086 100644
--- a/HISTORY
+++ b/HISTORY
@@ -6650,7 +6650,7 @@ Video Disk Recorder Revision History
- Added support for "content identifier descriptor" and "default authority descriptor"
to 'libsi' (thanks to Dave Pickles).
-2011-08-14: Version 1.7.20
+2011-08-15: Version 1.7.20
- Added some missing 'const' to tChannelID (reported by Sundararaj Reel).
- The isnumber() function now checks the given pointer for NULL (thanks to Holger
@@ -6686,3 +6686,5 @@ Video Disk Recorder Revision History
- The pic2mpg script of the 'pictures' plugin now generates HD images (thanks to
Andre Weidemann for his support in using convert/ffmpeg). The old SD version is
still available as pic2mpg-sd.
+- Added a mutex to protect cOsd::Osds from simultaneous access from different threads
+ (reported by Rolf Ahrenberg).
diff --git a/osd.c b/osd.c
index e5091aee..ab24e174 100644
--- a/osd.c
+++ b/osd.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: osd.c 2.22 2011/05/22 15:18:59 kls Exp $
+ * $Id: osd.c 2.23 2011/08/15 09:27:39 kls Exp $
*/
#include "osd.h"
@@ -1600,9 +1600,11 @@ int cOsd::osdTop = 0;
int cOsd::osdWidth = 0;
int cOsd::osdHeight = 0;
cVector<cOsd *> cOsd::Osds;
+cMutex cOsd::mutex;
cOsd::cOsd(int Left, int Top, uint Level)
{
+ cMutexLock MutexLock(&mutex);
isTrueColor = false;
savedBitmap = NULL;
numBitmaps = 0;
@@ -1624,6 +1626,7 @@ cOsd::cOsd(int Left, int Top, uint Level)
cOsd::~cOsd()
{
+ cMutexLock MutexLock(&mutex);
for (int i = 0; i < numBitmaps; i++)
delete bitmaps[i];
delete savedBitmap;
@@ -1944,6 +1947,7 @@ cOsdProvider::~cOsdProvider()
cOsd *cOsdProvider::NewOsd(int Left, int Top, uint Level)
{
+ cMutexLock MutexLock(&cOsd::mutex);
if (Level == OSD_LEVEL_DEFAULT && cOsd::IsOpen())
esyslog("ERROR: attempt to open OSD while it is already open - using dummy OSD!");
else if (osdProvider) {
diff --git a/osd.h b/osd.h
index b56853a3..ab10e42b 100644
--- a/osd.h
+++ b/osd.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: osd.h 2.13 2011/04/17 14:24:32 kls Exp $
+ * $Id: osd.h 2.14 2011/08/15 09:22:50 kls Exp $
*/
#ifndef __OSD_H
@@ -709,6 +709,7 @@ class cOsd {
private:
static int osdLeft, osdTop, osdWidth, osdHeight;
static cVector<cOsd *> Osds;
+ static cMutex mutex;
bool isTrueColor;
cBitmap *savedBitmap;
cBitmap *bitmaps[MAXOSDAREAS];