summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2005-02-27 18:00:00 +0100
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2005-02-27 18:00:00 +0100
commit05402c740765e6e0ca2aaf1760c77d9e3d3ed5a5 (patch)
tree366d8a8c2a637d83c406fa0debd41b8a701fada5 /device.c
parentdbacda8274e2d76b0ea42f90b94353b672fa9343 (diff)
downloadvdr-patch-lnbsharing-05402c740765e6e0ca2aaf1760c77d9e3d3ed5a5.tar.gz
vdr-patch-lnbsharing-05402c740765e6e0ca2aaf1760c77d9e3d3ed5a5.tar.bz2
Version 1.3.22vdr-1.3.22
- Removed some unneeded code and fixed access to unallocated memory in cEvent::FixEpgBugs() (thanks to Wolfgang Rohdewald). - Avoiding unnecessary calls to SetPid() in cDvbDevice::SetAudioTrackDevice() (thanks to Marco Schlüßler). - No longer calling EnsureAudioTrack() in cDevice::SetChannel() if a Transfer Mode is started, to avoid setting the audio PID on the primary device (thanks to Marco Schlüßler for pointing this out). - Replaced the call to system("sync") in SpinUpDisk() with fdatasync(f) to avoid problems on NPTL systems (thanks to Chris Warren for pointing this out). - Increased POLLTIMEOUTS_BEFORE_DEVICECLEAR in transfer.c to 6 to avoid problems with the larger buffer reserve (thanks to Marco Schlüßler). - Fixed the call to SetVideoFormat() in cDvbDevice::cDvbDevice() (parameter is _bool_). - Added support for setting the video display mode (thanks to Marco Schlüßler). - The new setup option "DVB/Video display format" can be used to define which display format to use for playing wide screen video on a 4:3 tv set. - Changed MAXDPIDS to 16 (8xAC3 + 8xDTS) (thanks to Werner Fink for pointing this out). - Completed Dutch language texts (thanks to Hans Dingemans). - Added 'smi' to the Finnish language codes (thanks to Rolf Ahrenberg). - Fixed ensuring there is a current audio track in case there is only one track (thanks to Werner Fink for reporting this one). - Improved automatic audio track selection. - Keeping the track language codes and descriptions in Transfer Mode (thanks to Luca Olivetti). - Fixed handling repeated kAudio keys. - Improved displaying the the current audio track in the ST:TNG channel display.
Diffstat (limited to 'device.c')
-rw-r--r--device.c53
1 files changed, 40 insertions, 13 deletions
diff --git a/device.c b/device.c
index f270b5a..d6ab891 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.92 2005/02/13 09:51:48 kls Exp $
+ * $Id: device.c 1.99 2005/02/27 13:55:15 kls Exp $
*/
#include "device.h"
@@ -169,7 +169,7 @@ cDevice::cDevice(void)
player = NULL;
pesAssembler = new cPesAssembler;
ClrAvailableTracks();
- currentAudioTrack = ttAudioFirst;
+ currentAudioTrack = ttNone;
currentAudioTrackMissingCount = 0;
for (int i = 0; i < MAXRECEIVERS; i++)
@@ -235,6 +235,7 @@ bool cDevice::SetPrimaryDevice(int n)
primaryDevice->MakePrimaryDevice(false);
primaryDevice = device[n];
primaryDevice->MakePrimaryDevice(true);
+ primaryDevice->SetVideoFormat(Setup.VideoFormat);
return true;
}
esyslog("ERROR: invalid primary device number: %d", n + 1);
@@ -327,6 +328,28 @@ bool cDevice::GrabImage(const char *FileName, bool Jpeg, int Quality, int SizeX,
return false;
}
+void cDevice::SetVideoDisplayFormat(eVideoDisplayFormat VideoDisplayFormat)
+{
+ cSpuDecoder *spuDecoder = GetSpuDecoder();
+ if (spuDecoder) {
+ if (Setup.VideoFormat)
+ spuDecoder->setScaleMode(cSpuDecoder::eSpuNormal);
+ else {
+ switch (VideoDisplayFormat) {
+ case vdfPanAndScan:
+ spuDecoder->setScaleMode(cSpuDecoder::eSpuPanAndScan);
+ break;
+ case vdfLetterBox:
+ spuDecoder->setScaleMode(cSpuDecoder::eSpuLetterBox);
+ break;
+ case vdfCenterCutOut:
+ spuDecoder->setScaleMode(cSpuDecoder::eSpuNormal);
+ break;
+ }
+ }
+ }
+}
+
void cDevice::SetVideoFormat(bool VideoFormat16_9)
{
}
@@ -578,14 +601,14 @@ eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView)
currentChannel = Channel->Number();
// Set the available audio tracks:
ClrAvailableTracks();
- currentAudioTrack = ttAudioFirst;
for (int i = 0; i < MAXAPIDS; i++)
SetAvailableTrack(ttAudio, i, Channel->Apid(i), Channel->Alang(i));
if (Setup.UseDolbyDigital) {
for (int i = 0; i < MAXDPIDS; i++)
SetAvailableTrack(ttDolby, i, Channel->Dpid(i), Channel->Dlang(i));
}
- EnsureAudioTrack(true);
+ if (!NeedsTransferMode)
+ EnsureAudioTrack(true);
}
cStatus::MsgChannelSwitch(this, Channel->Number()); // only report status if channel switch successfull
}
@@ -680,6 +703,7 @@ void cDevice::ClrAvailableTracks(bool DescriptionsOnly)
pre_1_3_19_PrivateStream = false;
SetAudioChannel(0); // fall back to stereo
currentAudioTrackMissingCount = 0;
+ currentAudioTrack = ttNone;
}
}
@@ -692,12 +716,14 @@ bool cDevice::SetAvailableTrack(eTrackType Type, int Index, uint16_t Id, const c
strn0cpy(availableTracks[t].language, Language, sizeof(availableTracks[t].language));
if (Description)
strn0cpy(availableTracks[t].description, Description, sizeof(availableTracks[t].description));
- if (Id)
+ if (Id) {
availableTracks[t].id = Id; // setting 'id' last to avoid the need for extensive locking
- if (t == currentAudioTrack)
- currentAudioTrackMissingCount = 0;
- else if (!availableTracks[currentAudioTrack].id && currentAudioTrackMissingCount++ > NumAudioTracks() * 10)
- EnsureAudioTrack();
+ int numAudioTracks = NumAudioTracks();
+ if (!availableTracks[currentAudioTrack].id && numAudioTracks && currentAudioTrackMissingCount++ > numAudioTracks * 10)
+ EnsureAudioTrack();
+ else if (t == currentAudioTrack)
+ currentAudioTrackMissingCount = 0;
+ }
return true;
}
else
@@ -816,7 +842,8 @@ bool cDevice::AttachPlayer(cPlayer *Player)
if (CanReplay()) {
if (player)
Detach(player);
- ClrAvailableTracks();
+ if (!dynamic_cast<cTransfer *>(Player))
+ ClrAvailableTracks();
pesAssembler->Reset();
player = Player;
SetPlayMode(player->playMode);
@@ -834,6 +861,7 @@ void cDevice::Detach(cPlayer *Player)
player->device = NULL;
player = NULL;
SetPlayMode(pmNone);
+ SetVideoDisplayFormat(eVideoDisplayFormat(Setup.VideoDisplayFormat));
Audios.ClearAudio();
}
}
@@ -894,7 +922,7 @@ int cDevice::PlayPesPacket(const uchar *Data, int Length, bool VideoOnly)
uchar SubStreamId = Data[PayloadOffset];
uchar SubStreamType = SubStreamId & 0xF0;
uchar SubStreamIndex = SubStreamId & 0x1F;
-
+
// Compatibility mode for old VDR recordings, where 0xBD was only AC3:
pre_1_3_19_PrivateStreamDeteced:
if (pre_1_3_19_PrivateStream) {
@@ -902,7 +930,6 @@ pre_1_3_19_PrivateStreamDeteced:
SubStreamType = 0x80;
SubStreamIndex = 0;
}
-
switch (SubStreamType) {
case 0x20: // SPU
case 0x30: // SPU
@@ -1002,7 +1029,7 @@ int cDevice::PlayPes(const uchar *Data, int Length, bool VideoOnly)
if (i < Length)
pesAssembler->Put(Data + i, Length - i);
return Length;
- }
+}
int cDevice::Ca(void) const
{