diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2002-10-13 18:00:00 +0200 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2002-10-13 18:00:00 +0200 |
commit | cd7ccd64fd51b77b8b75b6e85ef6891b1917aa59 (patch) | |
tree | 7de627368728c02bdf195a3cbca5418175638434 /dvbplayer.c | |
parent | 313e33539cd22fd571fc9a0f9f841173e9faebc4 (diff) | |
download | vdr-patch-lnbsharing-cd7ccd64fd51b77b8b75b6e85ef6891b1917aa59.tar.gz vdr-patch-lnbsharing-cd7ccd64fd51b77b8b75b6e85ef6891b1917aa59.tar.bz2 |
Version 1.1.13vdr-1.1.13
- Added cDevice::DeviceNumber() to get the number of a device, not counting any
gaps that might be in the index count.
- Fixed fetching the current/next information to handle cases where the duration
of an event is set wrongly and would last beyond the start time of the next
event.
- Adapted type names to the new HEAD version of the driver (which the previous
NEWSTRUCT branch has been merged into). Note that to use this driver version
you still need to add NEWSTRUCT=1 to the make call when building VDR. You
need a HEAD version of the LinuxDVB driver dated 2002-10-11 or later to compile
VDR with NEWSTRUCT=1.
- Fixed radio channels in channels.conf.cable (thanks to Robert Schiele and Uwe
Scheffler).
- Fixed switching the video format in the Setup/DVB menu (thanks to Uwe Scheffler
for reporting this one).
- Reactivated full handling of second audio PID (even in 'Transfer Mode').
- Fixed a crash when closing down with remote control plugins (thanks to Oliver
Endriss helping to debug this one).
- Commands in the file 'commands.conf' can now have a '?' at the end of their
title, which will result in a confirmation prompt before executing the
command.
- Changed a few leftover 'new char[...]' to MALLOC(char, ...).
- If a command executed from the "Commands" menu doesn't return any output, the
OSD will now be closed automatically.
- The SVDRP command PUTE now triggers an immediate write of the 'epg.data' file
(suggested by Gerhard Steiner).
- The new configuration file 'reccmds.conf' can be used to define commands that
shall be executed from the "Recordings" menu; see MANUAL and 'man vdr(5)' for
details (suggested by Gerhard Steiner).
Diffstat (limited to 'dvbplayer.c')
-rw-r--r-- | dvbplayer.c | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/dvbplayer.c b/dvbplayer.c index 7edadfb..927fde4 100644 --- a/dvbplayer.c +++ b/dvbplayer.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbplayer.c 1.13 2002/09/15 13:33:31 kls Exp $ + * $Id: dvbplayer.c 1.14 2002/10/12 12:29:31 kls Exp $ */ #include "dvbplayer.h" @@ -96,6 +96,8 @@ private: ePlayDirs playDir; int trickSpeed; int readIndex, writeIndex; + bool canToggleAudioTrack; + uchar audioTrack; cFrame *readFrame; const cFrame *playFrame; void TrickSpeed(int Increment); @@ -120,6 +122,9 @@ public: void Goto(int Position, bool Still = false); virtual bool GetIndex(int &Current, int &Total, bool SnapToIFrame = false); virtual bool GetReplayMode(bool &Play, bool &Forward, int &Speed); + virtual int NumAudioTracks(void) const; + virtual const char **GetAudioTracks(int *CurrentTrack = NULL) const; + virtual void SetAudioTrack(int Index); }; #define MAX_VIDEO_SLOWMOTION 63 // max. arg to pass to VIDEO_SLOWMOTION // TODO is this value correct? @@ -139,6 +144,8 @@ cDvbPlayer::cDvbPlayer(const char *FileName) playMode = pmPlay; playDir = pdForward; trickSpeed = NORMAL_SPEED; + canToggleAudioTrack = false; + audioTrack = 0xC0; readIndex = writeIndex = -1; readFrame = NULL; playFrame = NULL; @@ -216,7 +223,7 @@ void cDvbPlayer::StripAudioPackets(uchar *b, int Length, uchar Except) // continue with deleting the data - otherwise it disturbs DVB replay case 0xC0 ... 0xC1: // audio if (c == 0xC1) - ;//XXX+ canToggleAudioTrack = true; + canToggleAudioTrack = true; if (!Except || c != Except) { int n = l; for (int j = i; j < Length && n--; j++) @@ -353,7 +360,7 @@ void cDvbPlayer::Action(void) continue; } r = ReadFrame(replayFile, b, Length, sizeof(b)); - StripAudioPackets(b, r, 0xC0); //XXX+ audioTrack + StripAudioPackets(b, r, audioTrack); } else // allows replay even if the index file is missing r = read(replayFile, b, sizeof(b)); @@ -623,6 +630,31 @@ bool cDvbPlayer::GetReplayMode(bool &Play, bool &Forward, int &Speed) return true; } +int cDvbPlayer::NumAudioTracks(void) const +{ + return canToggleAudioTrack ? 2 : 1; +} + +const char **cDvbPlayer::GetAudioTracks(int *CurrentTrack = NULL) const +{ + if (NumAudioTracks()) { + if (CurrentTrack) + *CurrentTrack = (audioTrack == 0xC0) ? 0 : 1; + static const char *audioTracks1[] = { "Audio 1", NULL }; + static const char *audioTracks2[] = { "Audio 1", "Audio 2", NULL }; + return NumAudioTracks() > 1 ? audioTracks2 : audioTracks1; + } + return NULL; +} + +void cDvbPlayer::SetAudioTrack(int Index) +{ + if ((audioTrack == 0xC0) != (Index == 0)) { + audioTrack = (Index == 1) ? 0xC1 : 0xC0; + Empty(); + } +} + // --- cDvbPlayerControl ----------------------------------------------------- cDvbPlayerControl::cDvbPlayerControl(const char *FileName) |