summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'device.c')
-rw-r--r--device.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/device.c b/device.c
index 2df50dab..20394a59 100644
--- a/device.c
+++ b/device.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: device.c 1.64 2004/12/24 15:37:11 kls Exp $
+ * $Id: device.c 1.65 2005/01/02 14:08:40 kls Exp $
*/
#include "device.h"
@@ -604,15 +604,19 @@ void cDevice::ClrAvailableTracks(void)
memset(availableTracks, 0, sizeof(availableTracks));
}
-bool cDevice::SetAvailableTrack(eTrackType Type, int Index, uint16_t Id, const char *Language, uint32_t Flags)
+bool cDevice::SetAvailableTrack(eTrackType Type, int Index, uint16_t Id, const char *Language, const char *Description, uint32_t Flags)
{
eTrackType t = eTrackType(Type + Index);
if ((Type == ttAudio && IS_AUDIO_TRACK(t)) ||
(Type == ttDolby && IS_DOLBY_TRACK(t))) {
if (Language)
strn0cpy(availableTracks[t].language, Language, sizeof(availableTracks[t].language));
- availableTracks[t].flags = Flags;
- availableTracks[t].id = Id; // setting 'id' last to avoid the need for extensive locking
+ if (Description)
+ strn0cpy(availableTracks[t].description, Description, sizeof(availableTracks[t].description));
+ if (Id) {
+ availableTracks[t].flags = Flags;
+ availableTracks[t].id = Id; // setting 'id' last to avoid the need for extensive locking
+ }
return true;
}
else
@@ -652,21 +656,6 @@ bool cDevice::SetCurrentAudioTrack(eTrackType Type)
return false;
}
-bool cDevice::IncCurrentAudioTrack(void)
-{
- int i = currentAudioTrack + 1;
- for (;;) {
- if (i > ttDolbyLast)
- i = ttAudioFirst;
- if (i == currentAudioTrack)
- break;
- if (availableTracks[i].id)
- return SetCurrentAudioTrack(eTrackType(i));
- i++;
- }
- return false;
-}
-
bool cDevice::CanReplay(void) const
{
return HasDecoder();