summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-11-05 12:12:18 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2005-11-05 12:12:18 +0100
commit596e965a5334fec97b4ee4fd19223b6acfacf680 (patch)
treec4b91241f306ef94c9736bdad5e4137c863c66e7
parent9607fd33a061530b3e26e2ffae14e87548b016ba (diff)
downloadvdr-596e965a5334fec97b4ee4fd19223b6acfacf680.tar.gz
vdr-596e965a5334fec97b4ee4fd19223b6acfacf680.tar.bz2
Fixed a race condition in the SPU decoder
-rw-r--r--CONTRIBUTORS1
-rw-r--r--HISTORY1
-rw-r--r--dvbspu.c4
-rw-r--r--dvbspu.h5
4 files changed, 8 insertions, 3 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 491a0fd2..a280fdc5 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -1241,6 +1241,7 @@ Marco Schlüßler <marco@lordzodiac.de>
for fixing detecting short channel names for "Kabel Deutschland"
for reporting that the FATALERRNO macro needs to check for a non-zero errno value
for reporting missing mutex locks in cCiMenu::Abort() and cCiEnquiry::Abort()
+ for fixing a race condition in the SPU decoder
Jürgen Schmitz <j.schmitz@web.de>
for reporting a bug in displaying the current channel when switching via the SVDRP
diff --git a/HISTORY b/HISTORY
index 013b3e72..a91667ad 100644
--- a/HISTORY
+++ b/HISTORY
@@ -3933,3 +3933,4 @@ Video Disk Recorder Revision History
commands of any length. The MAXPARSEBUFFER macros is now obsolete and has
been removed. If a plugin has used that macro, it should either define
a buffer size of its own, or use cReadLine when reading files.
+- Fixed a race condition in the SPU decoder (thanks to Marco Schlüßler).
diff --git a/dvbspu.c b/dvbspu.c
index f9a1df41..9887cc05 100644
--- a/dvbspu.c
+++ b/dvbspu.c
@@ -8,7 +8,7 @@
*
* parts of this file are derived from the OMS program.
*
- * $Id: dvbspu.c 1.16 2005/11/04 14:19:07 kls Exp $
+ * $Id: dvbspu.c 1.17 2005/11/05 12:08:15 kls Exp $
*/
#include <assert.h>
@@ -338,6 +338,7 @@ sDvbSpuRect cDvbSpuDecoder::CalcAreaSize(sDvbSpuRect fgsize, cBitmap *fgbmp, sDv
void cDvbSpuDecoder::Draw(void)
{
+ cMutexLock MutexLock(&mutex);
if (!spubmp) {
Hide();
return;
@@ -390,6 +391,7 @@ void cDvbSpuDecoder::Draw(void)
void cDvbSpuDecoder::Hide(void)
{
+ cMutexLock MutexLock(&mutex);
delete osd;
osd = NULL;
}
diff --git a/dvbspu.h b/dvbspu.h
index 8a7d9051..e018c702 100644
--- a/dvbspu.h
+++ b/dvbspu.h
@@ -8,7 +8,7 @@
*
* parts of this file are derived from the OMS program.
*
- * $Id: dvbspu.h 1.9 2005/05/07 11:14:03 kls Exp $
+ * $Id: dvbspu.h 1.10 2005/11/05 12:08:47 kls Exp $
*/
#ifndef __DVBSPU_H
@@ -91,7 +91,8 @@ class cDvbSpuBitmap {
class cDvbSpuDecoder:public cSpuDecoder {
private:
- cOsd * osd;
+ cOsd *osd;
+ cMutex mutex;
// processing state
uint8_t *spu;