Fixed a possible deadlock when changing the audio track while replaying a recording

This commit is contained in:
Klaus Schmidinger 2013-03-07 13:27:05 +01:00
parent 16c931453d
commit a67fe0663d
3 changed files with 4 additions and 7 deletions

View File

@ -7720,3 +7720,4 @@ Video Disk Recorder Revision History
- Renamed the "plp id" to a more general "stream id" and added support for DVB-S2
"Input Stream Identifier" (ISI) (based on a patch from Rolf Ahrenberg).
With this VDR now supports "multi streaming" on DVB-S2 and DVB-T2 transponders.
- Fixed a possible deadlock when changing the audio track while replaying a recording.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: device.c 2.73 2013/02/16 14:39:30 kls Exp $
* $Id: device.c 2.74 2013/03/07 13:18:35 kls Exp $
*/
#include "device.h"
@ -1290,7 +1290,6 @@ int cDevice::PlaySubtitle(const uchar *Data, int Length)
int cDevice::PlayPesPacket(const uchar *Data, int Length, bool VideoOnly)
{
cMutexLock MutexLock(&mutexCurrentAudioTrack);
bool FirstLoop = true;
uchar c = Data[3];
const uchar *Start = Data;
@ -1468,7 +1467,7 @@ int cDevice::PlayTsSubtitle(const uchar *Data, int Length)
int cDevice::PlayTs(const uchar *Data, int Length, bool VideoOnly)
{
int Played = 0;
if (Data == NULL) {
if (!Data) {
tsToPesVideo.Reset();
tsToPesAudio.Reset();
tsToPesSubtitle.Reset();
@ -1478,7 +1477,6 @@ int cDevice::PlayTs(const uchar *Data, int Length, bool VideoOnly)
return Length;
}
else {
cMutexLock MutexLock(&mutexCurrentAudioTrack);
while (Length >= TS_SIZE) {
if (Data[0] != TS_SYNC_BYTE) {
int Skipped = 1;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: dvbplayer.c 2.32 2013/02/25 12:15:58 kls Exp $
* $Id: dvbplayer.c 2.33 2013/03/07 13:05:15 kls Exp $
*/
#include "dvbplayer.h"
@ -810,8 +810,6 @@ void cDvbPlayer::Goto(int Index, bool Still)
void cDvbPlayer::SetAudioTrack(eTrackType Type, const tTrackId *TrackId)
{
if (isPesRecording)
return; // for some unknown reason this doesn't work with PES recordings - causes a segfault
if (playMode == pmPlay) {
int Current, Total;
if (GetIndex(Current, Total, true))