Starting Transfer Mode when recording current channel

This commit is contained in:
Klaus Schmidinger 2002-09-15 10:51:44 +02:00
parent fd3cc6f997
commit 6ef11b70be
3 changed files with 48 additions and 26 deletions

View File

@ -147,6 +147,7 @@ Stefan Huelswitt <huels@iname.com>
for improving cCondVar::Wait() and implementing cCondVar::TimedWait() for improving cCondVar::Wait() and implementing cCondVar::TimedWait()
for reporting a bug when entering an integer value outside the limit for reporting a bug when entering an integer value outside the limit
for adding play mode pmAudioOnlyBlack for adding play mode pmAudioOnlyBlack
for helping to fix starting a recording of the current channel with only one DVB card
Ulrich Röder <roeder@efr-net.de> Ulrich Röder <roeder@efr-net.de>
for pointing out that there are channels that have a symbol rate higher than for pointing out that there are channels that have a symbol rate higher than

View File

@ -1460,8 +1460,9 @@ Video Disk Recorder Revision History
Stefan Huelswitt for reporting this one). Stefan Huelswitt for reporting this one).
- Added play mode pmAudioOnlyBlack (thanks to Stefan Huelswitt). - Added play mode pmAudioOnlyBlack (thanks to Stefan Huelswitt).
2002-09-14: Version 1.1.10 2002-09-15: Version 1.1.10
- Removed a superfluous error message from cLockFile::Unlock() (reported by - Removed a superfluous error message from cLockFile::Unlock() (reported by
Helmut Auer). Helmut Auer).
- Fixed starting a recording of the current channel with only one DVB card. - Fixed starting a recording of the current channel with only one DVB card
(thanks to Stefan Huelswitt for his help).

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: dvbdevice.c 1.16 2002/09/14 13:26:16 kls Exp $ * $Id: dvbdevice.c 1.17 2002/09/15 10:43:12 kls Exp $
*/ */
#include "dvbdevice.h" #include "dvbdevice.h"
@ -390,30 +390,52 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
LiveView = true; LiveView = true;
#endif #endif
// Avoid noise while switching: bool DoTune = frequency != Channel->frequency; // TODO will be changed when DiSEqC handling is revised
if (HasDecoder()) { bool TurnOffLivePIDs = HasDecoder()
CHECK(ioctl(fd_audio, AUDIO_SET_MUTE, true)); && (DoTune
CHECK(ioctl(fd_video, VIDEO_SET_BLANK, true)); || Channel->ca > CACONFBASE // CA channels can only be decrypted in "live" mode
CHECK(ioctl(fd_audio, AUDIO_CLEAR_BUFFER)); || IsPrimaryDevice()
CHECK(ioctl(fd_video, VIDEO_CLEAR_BUFFER)); && (LiveView // for a new live view the old PIDs need to be turned off
} || pidHandles[ptVideo].pid == Channel->vpid // for recording the PIDs must be shifted from DMX_PES_AUDIO/VIDEO to DMX_PES_OTHER
)
);
bool StartTransferMode = IsPrimaryDevice() && !DoTune
&& (LiveView && HasPid(Channel->vpid) && pidHandles[ptVideo].pid != Channel->vpid // the PID is already set as DMX_PES_OTHER
|| !LiveView && pidHandles[ptVideo].pid == Channel->vpid // a recording is going to shift the PIDs from DMX_PES_AUDIO/VIDEO to DMX_PES_OTHER
);
bool TurnOnLivePIDs = HasDecoder() && !StartTransferMode
&& (Channel->ca > CACONFBASE // CA channels can only be decrypted in "live" mode
|| LiveView
);
// Stop setting system time: // Stop setting system time:
if (siProcessor) if (siProcessor)
siProcessor->SetCurrentTransponder(0); siProcessor->SetCurrentTransponder(0);
// Turn off current PIDs: // Turn off live PIDs if necessary:
if (TurnOffLivePIDs) {
// Avoid noise while switching:
CHECK(ioctl(fd_audio, AUDIO_SET_MUTE, true));
CHECK(ioctl(fd_video, VIDEO_SET_BLANK, true));
CHECK(ioctl(fd_audio, AUDIO_CLEAR_BUFFER));
CHECK(ioctl(fd_video, VIDEO_CLEAR_BUFFER));
// Turn off live PIDs:
if (IsPrimaryDevice() && (LiveView || pidHandles[ptVideo].pid == Channel->vpid)) {
DelPid(pidHandles[ptAudio].pid); DelPid(pidHandles[ptAudio].pid);
DelPid(pidHandles[ptVideo].pid); DelPid(pidHandles[ptVideo].pid);
DelPid(pidHandles[ptTeletext].pid); DelPid(pidHandles[ptTeletext].pid);
DelPid(pidHandles[ptDolby].pid); DelPid(pidHandles[ptDolby].pid);
} }
if (frequency != Channel->frequency || Channel->ca > CACONFBASE) { // CA channels can only be decrypted in "live" mode if (DoTune) {
#ifdef NEWSTRUCT #ifdef NEWSTRUCT
dvb_frontend_parameters Frontend; dvb_frontend_parameters Frontend;
@ -595,21 +617,19 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
// PID settings: // PID settings:
if (HasDecoder() && (LiveView || !IsPrimaryDevice() || Channel->ca > CACONFBASE)) { // CA channels can only be decrypted in "live" mode if (TurnOnLivePIDs) {
if (!HasPid(Channel->vpid) && (IsPrimaryDevice() || !pidHandles[ptVideo].used || Channel->ca > CACONFBASE)) { if (!(AddPid(Channel->apid1, ptAudio) && AddPid(Channel->vpid, ptVideo))) {//XXX+ dolby dpid1!!! (if audio plugins are attached)
if (!(AddPid(Channel->apid1, ptAudio) && AddPid(Channel->vpid, ptVideo))) {//XXX+ dolby dpid1!!! (if audio plugins are attached) esyslog("ERROR: failed to set PIDs for channel %d on device %d", Channel->number, CardIndex() + 1);
esyslog("ERROR: failed to set PIDs for channel %d", Channel->number); return false;
return false;
}
if (IsPrimaryDevice())
AddPid(Channel->tpid, ptTeletext);
CHECK(ioctl(fd_audio, AUDIO_SET_AV_SYNC, true));
CHECK(ioctl(fd_audio, AUDIO_SET_MUTE, false));
CHECK(ioctl(fd_video, VIDEO_SET_BLANK, false));
} }
else if (LiveView) if (IsPrimaryDevice())
cControl::Launch(new cTransferControl(this, Channel->vpid, Channel->apid1, 0, 0, 0)); AddPid(Channel->tpid, ptTeletext);
CHECK(ioctl(fd_audio, AUDIO_SET_AV_SYNC, true));
CHECK(ioctl(fd_audio, AUDIO_SET_MUTE, false));
CHECK(ioctl(fd_video, VIDEO_SET_BLANK, false));
} }
else if (StartTransferMode)
cControl::Launch(new cTransferControl(this, Channel->vpid, Channel->apid1, 0, 0, 0));
// Start setting system time: // Start setting system time: