diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2015-02-07 14:29:14 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2015-02-07 14:29:14 +0100 |
commit | 18e7903b78f856d9959257bc88b307b80c460681 (patch) | |
tree | febf5c714a0f0987fffae08bf8da28b34cdd5759 /menu.c | |
parent | 5d8302b147aeb43d53f26ebd98e728df4adebe46 (diff) | |
download | vdr-18e7903b78f856d9959257bc88b307b80c460681.tar.gz vdr-18e7903b78f856d9959257bc88b307b80c460681.tar.bz2 |
Fixed a deadlock in accessing marks
Diffstat (limited to 'menu.c')
-rw-r--r-- | menu.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.c 3.43 2015/02/06 15:20:11 kls Exp $ + * $Id: menu.c 3.44 2015/02/07 14:14:50 kls Exp $ */ #include "menu.h" @@ -5390,11 +5390,15 @@ void cReplayControl::MarkToggle(void) int Current, Total; if (GetIndex(Current, Total, true)) { lastCurrent = -1; // triggers redisplay - cMutexLock MutexLock(&marks); - if (cMark *m = marks.Get(Current)) + if (cMark *m = marks.Get(Current)) { + marks.Lock(); marks.Del(m); + marks.Unlock(); + } else { + marks.Lock(); marks.Add(Current); + marks.Unlock(); bool Play, Forward; int Speed; if (Setup.PauseOnMarkSet || GetReplayMode(Play, Forward, Speed) && !Play) { @@ -5411,7 +5415,6 @@ void cReplayControl::MarkJump(bool Forward) { int Current, Total; if (GetIndex(Current, Total)) { - cMutexLock MutexLock(&marks); if (marks.Count()) { if (cMark *m = Forward ? marks.GetNext(Current) : marks.GetPrev(Current)) { if (!Setup.PauseOnMarkJump) { @@ -5440,7 +5443,6 @@ void cReplayControl::MarkMove(int Frames, bool MarkRequired) bool Play, Forward; int Speed; GetReplayMode(Play, Forward, Speed); - cMutexLock MutexLock(&marks); cMark *m = marks.Get(Current); if (!Play && m) { displayFrames = true; @@ -5476,7 +5478,6 @@ void cReplayControl::EditCut(void) if (*fileName) { Hide(); if (!RecordingsHandler.GetUsage(fileName)) { - cMutexLock MutexLock(&marks); if (!marks.Count()) Skins.Message(mtError, tr("No editing marks defined!")); else if (!marks.GetNumSequences()) @@ -5498,7 +5499,6 @@ void cReplayControl::EditTest(void) { int Current, Total; if (GetIndex(Current, Total)) { - cMutexLock MutexLock(&marks); cMark *m = marks.Get(Current); if (!m) m = marks.GetNext(Current); |