Now starting the Dolby Digital output thread only if the recording actually contains Dolby Digital audio data

This commit is contained in:
Klaus Schmidinger 2002-03-09 12:09:57 +01:00
parent ac5aecb8eb
commit cb90e9b8dc
3 changed files with 11 additions and 7 deletions

View File

@ -147,6 +147,8 @@ Werner Fink <werner@suse.de>
for making I/O more robust by handling EINTR for making I/O more robust by handling EINTR
for fixing closing all unused file descriptors when opening a pipe for fixing closing all unused file descriptors when opening a pipe
for helping to debug leftover 'zombie' processes when closing a pipe for helping to debug leftover 'zombie' processes when closing a pipe
for making the Dolby Digital thread start only if the recording actually
contains Dolby Digital data
Rolf Hakenes <hakenes@hippomi.de> Rolf Hakenes <hakenes@hippomi.de>
for providing 'libdtv' and adapting the EIT mechanisms to it for providing 'libdtv' and adapting the EIT mechanisms to it

View File

@ -1086,3 +1086,5 @@ Video Disk Recorder Revision History
- Fixed closing a pipe (used for replaying Dolby Digital audio), which - Fixed closing a pipe (used for replaying Dolby Digital audio), which
sometimes left 'zombie' processes behind (thanks to Werner Fink for helping sometimes left 'zombie' processes behind (thanks to Werner Fink for helping
to debug this one). to debug this one).
- Now starting the Dolby Digital output thread only if the recording actually
contains Dolby Digital audio data (thanks to Werner Fink).

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: dvbapi.c 1.159 2002/03/09 10:14:07 kls Exp $ * $Id: dvbapi.c 1.160 2002/03/09 11:59:39 kls Exp $
*/ */
#include "dvbapi.h" #include "dvbapi.h"
@ -746,10 +746,6 @@ cPlayBuffer::cPlayBuffer(cDvbApi *DvbApi, int VideoDev, int AudioDev)
canToggleAudioTrack = false; canToggleAudioTrack = false;
skipAC3bytes = false; skipAC3bytes = false;
audioTrack = 0xC0; audioTrack = 0xC0;
if (cDvbApi::AudioCommand()) {
if (!dolbyDev.Open(cDvbApi::AudioCommand(), "w"))
esyslog(LOG_ERR, "ERROR: can't open pipe to audio command '%s'", cDvbApi::AudioCommand());
}
} }
cPlayBuffer::~cPlayBuffer() cPlayBuffer::~cPlayBuffer()
@ -758,7 +754,11 @@ cPlayBuffer::~cPlayBuffer()
void cPlayBuffer::PlayExternalDolby(const uchar *b, int MaxLength) void cPlayBuffer::PlayExternalDolby(const uchar *b, int MaxLength)
{ {
if (dolbyDev) { if (cDvbApi::AudioCommand()) {
if (!dolbyDev && !dolbyDev.Open(cDvbApi::AudioCommand(), "w")) {
esyslog(LOG_ERR, "ERROR: can't open pipe to audio command '%s'", cDvbApi::AudioCommand());
return;
}
if (b[0] == 0x00 && b[1] == 0x00 && b[2] == 0x01) { if (b[0] == 0x00 && b[1] == 0x00 && b[2] == 0x01) {
if (b[3] == 0xBD) { // dolby if (b[3] == 0xBD) { // dolby
int l = b[4] * 256 + b[5] + 6; int l = b[4] * 256 + b[5] + 6;
@ -1150,7 +1150,7 @@ void cReplayBuffer::StripAudioPackets(uchar *b, int Length, uchar Except)
int l = b[i + 4] * 256 + b[i + 5] + 6; int l = b[i + 4] * 256 + b[i + 5] + 6;
switch (c) { switch (c) {
case 0xBD: // dolby case 0xBD: // dolby
if (Except && dolbyDev) if (Except)
PlayExternalDolby(&b[i], Length - i); PlayExternalDolby(&b[i], Length - i);
// continue with deleting the data - otherwise it disturbs DVB replay // continue with deleting the data - otherwise it disturbs DVB replay
case 0xC0 ... 0xC1: // audio case 0xC0 ... 0xC1: // audio