Added a mutex to synchronize cDevice::PlayPesPacket() and SetCurrentAudioTrack()

This commit is contained in:
Klaus Schmidinger 2006-01-08 10:13:38 +01:00
parent f7bf9b4090
commit b464dc407d
4 changed files with 9 additions and 3 deletions

View File

@ -1019,6 +1019,7 @@ Reinhard Nissl <rnissl@gmx.de>
for suggesting to make the DVB devices retune (and, if applicable, resend the for suggesting to make the DVB devices retune (and, if applicable, resend the
DiSEqC data) if the lock is lost DiSEqC data) if the lock is lost
for fixing handling TS packets in cTS2PES for fixing handling TS packets in cTS2PES
for adding a mutex to synchronize cDevice::PlayPesPacket() and SetCurrentAudioTrack()
Richard Robson <richard_robson@beeb.net> Richard Robson <richard_robson@beeb.net>
for reporting freezing replay if a timer starts while in Transfer Mode from the for reporting freezing replay if a timer starts while in Transfer Mode from the

View File

@ -3963,7 +3963,7 @@ Video Disk Recorder Revision History
commands may now be executed at any time, and the message will be displayed commands may now be executed at any time, and the message will be displayed
(no more "pending message"). (no more "pending message").
2006-01-07: Version 1.3.38 2006-01-08: Version 1.3.38
- Fixed handling second audio and Dolby Digital PIDs for encrypted channels - Fixed handling second audio and Dolby Digital PIDs for encrypted channels
(was broken in version 1.3.37). (was broken in version 1.3.37).
@ -4129,3 +4129,5 @@ Video Disk Recorder Revision History
- The file 'ca.conf' is obsolete and has been removed. - The file 'ca.conf' is obsolete and has been removed.
- Revised all descriptions regarding CICAM. - Revised all descriptions regarding CICAM.
- Adapted c(Dvb)Device::ProvidesCa() to the dynamic CA handling. - Adapted c(Dvb)Device::ProvidesCa() to the dynamic CA handling.
- Added a mutex to synchronize cDevice::PlayPesPacket() and SetCurrentAudioTrack()
(thanks to Reinhard Nissl).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: device.c 1.119 2006/01/07 14:50:45 kls Exp $ * $Id: device.c 1.120 2006/01/08 10:11:42 kls Exp $
*/ */
#include "device.h" #include "device.h"
@ -830,6 +830,7 @@ int cDevice::NumAudioTracks(void) const
bool cDevice::SetCurrentAudioTrack(eTrackType Type) bool cDevice::SetCurrentAudioTrack(eTrackType Type)
{ {
if (ttNone < Type && Type < ttDolbyLast) { if (ttNone < Type && Type < ttDolbyLast) {
cMutexLock MutexLock(&mutexCurrentAudioTrack);
if (IS_DOLBY_TRACK(Type)) if (IS_DOLBY_TRACK(Type))
SetDigitalAudioDevice(true); SetDigitalAudioDevice(true);
currentAudioTrack = Type; currentAudioTrack = Type;
@ -983,6 +984,7 @@ int cDevice::PlayAudio(const uchar *Data, int Length)
int cDevice::PlayPesPacket(const uchar *Data, int Length, bool VideoOnly) int cDevice::PlayPesPacket(const uchar *Data, int Length, bool VideoOnly)
{ {
cMutexLock MutexLock(&mutexCurrentAudioTrack);
bool FirstLoop = true; bool FirstLoop = true;
uchar c = Data[3]; uchar c = Data[3];
const uchar *Start = Data; const uchar *Start = Data;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: device.h 1.69 2006/01/07 14:50:45 kls Exp $ * $Id: device.h 1.70 2006/01/08 10:10:26 kls Exp $
*/ */
#ifndef __DEVICE_H #ifndef __DEVICE_H
@ -344,6 +344,7 @@ public:
private: private:
tTrackId availableTracks[ttMaxTrackTypes]; tTrackId availableTracks[ttMaxTrackTypes];
eTrackType currentAudioTrack; eTrackType currentAudioTrack;
cMutex mutexCurrentAudioTrack;
int currentAudioTrackMissingCount; int currentAudioTrackMissingCount;
bool pre_1_3_19_PrivateStream; bool pre_1_3_19_PrivateStream;
protected: protected: