1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

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 reporting a bug when entering an integer value outside the limit
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>
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).
- 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
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
* 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"
@ -390,30 +390,52 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
LiveView = true;
#endif
// Avoid noise while switching:
bool DoTune = frequency != Channel->frequency; // TODO will be changed when DiSEqC handling is revised
if (HasDecoder()) {
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));
}
bool TurnOffLivePIDs = HasDecoder()
&& (DoTune
|| Channel->ca > CACONFBASE // CA channels can only be decrypted in "live" mode
|| IsPrimaryDevice()
&& (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:
if (siProcessor)
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[ptVideo].pid);
DelPid(pidHandles[ptTeletext].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
dvb_frontend_parameters Frontend;
@ -595,21 +617,19 @@ bool cDvbDevice::SetChannelDevice(const cChannel *Channel, bool LiveView)
// PID settings:
if (HasDecoder() && (LiveView || !IsPrimaryDevice() || Channel->ca > CACONFBASE)) { // CA channels can only be decrypted in "live" mode
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)
esyslog("ERROR: failed to set PIDs for channel %d", Channel->number);
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));
if (TurnOnLivePIDs) {
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);
return false;
}
else if (LiveView)
cControl::Launch(new cTransferControl(this, Channel->vpid, Channel->apid1, 0, 0, 0));
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 (StartTransferMode)
cControl::Launch(new cTransferControl(this, Channel->vpid, Channel->apid1, 0, 0, 0));
// Start setting system time: