From 22b7528b63c5f08f979e05d3d4ce0c5865ddddf4 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Mon, 6 Aug 2001 16:24:13 +0200 Subject: Audio patch from Andreas Schultz --- dvbapi.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'dvbapi.c') diff --git a/dvbapi.c b/dvbapi.c index 5406a189..0524f00f 100644 --- a/dvbapi.c +++ b/dvbapi.c @@ -7,11 +7,10 @@ * DVD support initially written by Andreas Schultz * based on dvdplayer-0.5 by Matjaz Thaler * - * $Id: dvbapi.c 1.100 2001/08/06 16:19:20 kls Exp $ + * $Id: dvbapi.c 1.101 2001/08/06 16:24:13 kls Exp $ */ //#define DVDDEBUG 1 -//#define DVDDEBUG_BUFFER 1 #include "dvbapi.h" #include @@ -1262,7 +1261,6 @@ unsigned int cDVDplayBuffer::getAudioStream(unsigned int StreamId) return 0; if (!(cur_pgc->audio_control[StreamId] & 0x8000)) return 0; - //FIXME: maybe we can use the values directly??? int track = (cur_pgc->audio_control[StreamId] >> 8) & 0x07; switch (vts_file->vtsi_mat->vts_audio_attr[track].audio_format) { case 0: // ac3 @@ -1285,7 +1283,7 @@ void cDVDplayBuffer::ToggleAudioTrack(void) { unsigned int newTrack; - if (CanToggleAudioTrack()) { + if (CanToggleAudioTrack() && maxAudioTrack != 0) { logAudioTrack = (logAudioTrack + 1) % maxAudioTrack; if ((newTrack = getAudioStream(logAudioTrack)) != 0) audioTrack = newTrack; @@ -1407,6 +1405,7 @@ void cDVDplayBuffer::Input(void) if (!(cur_pgc->audio_control[maxAudioTrack] & 0x8000)) break; } + canToggleAudioTrack = (maxAudioTrack > 0); // init the AudioInformation audioTrack = getAudioStream(logAudioTrack); #ifdef DVDDEBUG -- cgit v1.2.3