mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
No longer actually tuning the primary interface in 'Transfer Mode'
This commit is contained in:
parent
5d415c08d0
commit
bdfeda21c7
5
HISTORY
5
HISTORY
@ -586,7 +586,6 @@ Video Disk Recorder Revision History
|
|||||||
- DiSEqC support can now be generally enabled/disabled in the Setup menu. This
|
- DiSEqC support can now be generally enabled/disabled in the Setup menu. This
|
||||||
may be necessary if your multiswitch gets irritated by the default DiSEqC
|
may be necessary if your multiswitch gets irritated by the default DiSEqC
|
||||||
codes '0' (thanks to Markus Lang).
|
codes '0' (thanks to Markus Lang).
|
||||||
- Avoiding audio/video distortions in 'Transfer Mode'.
|
|
||||||
- Fixed replaying in case there is no index file.
|
- Fixed replaying in case there is no index file.
|
||||||
- Fixed jumping to an editing mark when replay has been paused.
|
- Fixed jumping to an editing mark when replay has been paused.
|
||||||
- Avoiding unnecessary code execution in the replay progress display (thanks
|
- Avoiding unnecessary code execution in the replay progress display (thanks
|
||||||
@ -603,3 +602,7 @@ Video Disk Recorder Revision History
|
|||||||
confirmation messages (like "Delete...") to "black on yellow".
|
confirmation messages (like "Delete...") to "black on yellow".
|
||||||
- Fixed display with DEBUG_OSD (it still crashes sometimes, esp. when replaying,
|
- Fixed display with DEBUG_OSD (it still crashes sometimes, esp. when replaying,
|
||||||
but I can't seem to find what causes this... any ideas anybody?).
|
but I can't seem to find what causes this... any ideas anybody?).
|
||||||
|
- Avoiding audio/video distortions in 'Transfer Mode' by no longer actually
|
||||||
|
tuning the primary interface (which can't receive this channel, anyway).
|
||||||
|
Apparently the driver gets irritated when the channel is switched and a
|
||||||
|
replay session is started immediately after that.
|
||||||
|
33
dvbapi.c
33
dvbapi.c
@ -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: dvbapi.c 1.93 2001/07/28 11:45:04 kls Exp $
|
* $Id: dvbapi.c 1.94 2001/07/29 09:00:19 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dvbapi.h"
|
#include "dvbapi.h"
|
||||||
@ -2116,6 +2116,15 @@ bool cDvbApi::SetChannel(int ChannelNumber, int FrequencyMHz, char Polarization,
|
|||||||
StopTransfer();
|
StopTransfer();
|
||||||
StopReplay();
|
StopReplay();
|
||||||
|
|
||||||
|
// Must set this anyway to avoid getting stuck when switching through
|
||||||
|
// channels with 'Up' and 'Down' keys:
|
||||||
|
currentChannel = ChannelNumber;
|
||||||
|
vPid = Vpid;
|
||||||
|
aPid1 = Apid1;
|
||||||
|
aPid2 = Apid2;
|
||||||
|
dPid1 = Dpid1;
|
||||||
|
dPid2 = Dpid2;
|
||||||
|
|
||||||
// Avoid noise while switching:
|
// Avoid noise while switching:
|
||||||
|
|
||||||
if (fd_video >= 0 && fd_audio >= 0) {
|
if (fd_video >= 0 && fd_audio >= 0) {
|
||||||
@ -2125,6 +2134,13 @@ bool cDvbApi::SetChannel(int ChannelNumber, int FrequencyMHz, char Polarization,
|
|||||||
CHECK(ioctl(fd_audio, AUDIO_CLEAR_BUFFER));
|
CHECK(ioctl(fd_audio, AUDIO_CLEAR_BUFFER));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If this card can't receive this channel, we must not actually switch
|
||||||
|
// the channel here, because that would irritate the driver when we
|
||||||
|
// start replaying in Transfer Mode immediately after switching the channel:
|
||||||
|
bool NeedsTransferMode = (this == PrimaryDvbApi && Ca && Ca != Index() + 1);
|
||||||
|
|
||||||
|
if (!NeedsTransferMode) {
|
||||||
|
|
||||||
// Turn off current PIDs:
|
// Turn off current PIDs:
|
||||||
|
|
||||||
SetVpid( 0x1FFF, DMX_OUT_DECODER);
|
SetVpid( 0x1FFF, DMX_OUT_DECODER);
|
||||||
@ -2134,10 +2150,6 @@ bool cDvbApi::SetChannel(int ChannelNumber, int FrequencyMHz, char Polarization,
|
|||||||
SetDpid2(0x1FFF, DMX_OUT_DECODER);
|
SetDpid2(0x1FFF, DMX_OUT_DECODER);
|
||||||
SetTpid( 0x1FFF, DMX_OUT_DECODER);
|
SetTpid( 0x1FFF, DMX_OUT_DECODER);
|
||||||
|
|
||||||
// Must set this anyway to avoid getting stuck when switching through
|
|
||||||
// channels with 'Up' and 'Down' keys:
|
|
||||||
currentChannel = ChannelNumber;
|
|
||||||
|
|
||||||
bool ChannelSynced = false;
|
bool ChannelSynced = false;
|
||||||
|
|
||||||
if (fd_qpskfe >= 0 && fd_sec >= 0) { // DVB-S
|
if (fd_qpskfe >= 0 && fd_sec >= 0) { // DVB-S
|
||||||
@ -2239,11 +2251,6 @@ bool cDvbApi::SetChannel(int ChannelNumber, int FrequencyMHz, char Polarization,
|
|||||||
|
|
||||||
// PID settings:
|
// PID settings:
|
||||||
|
|
||||||
vPid = Vpid;
|
|
||||||
aPid1 = Apid1;
|
|
||||||
aPid2 = Apid2;
|
|
||||||
dPid1 = Dpid1;
|
|
||||||
dPid2 = Dpid2;
|
|
||||||
if (!SetPids(false)) {
|
if (!SetPids(false)) {
|
||||||
esyslog(LOG_ERR, "ERROR: failed to set PIDs for channel %d", ChannelNumber);
|
esyslog(LOG_ERR, "ERROR: failed to set PIDs for channel %d", ChannelNumber);
|
||||||
return false;
|
return false;
|
||||||
@ -2251,24 +2258,26 @@ bool cDvbApi::SetChannel(int ChannelNumber, int FrequencyMHz, char Polarization,
|
|||||||
SetTpid(Tpid, DMX_OUT_DECODER);
|
SetTpid(Tpid, DMX_OUT_DECODER);
|
||||||
if (fd_audio >= 0)
|
if (fd_audio >= 0)
|
||||||
CHECK(ioctl(fd_audio, AUDIO_SET_AV_SYNC, true));
|
CHECK(ioctl(fd_audio, AUDIO_SET_AV_SYNC, true));
|
||||||
|
}
|
||||||
|
|
||||||
if (this == PrimaryDvbApi && siProcessor)
|
if (this == PrimaryDvbApi && siProcessor)
|
||||||
siProcessor->SetCurrentServiceID(Pnr);
|
siProcessor->SetCurrentServiceID(Pnr);
|
||||||
|
|
||||||
// If this DVB card can't receive this channel, let's see if we can
|
// If this DVB card can't receive this channel, let's see if we can
|
||||||
// use the card that actually can receive it and transfer data from there:
|
// use the card that actually can receive it and transfer data from there:
|
||||||
|
|
||||||
if (this == PrimaryDvbApi && Ca && Ca != Index() + 1) {
|
if (NeedsTransferMode) {
|
||||||
cDvbApi *CaDvbApi = GetDvbApi(Ca, 0);
|
cDvbApi *CaDvbApi = GetDvbApi(Ca, 0);
|
||||||
if (CaDvbApi) {
|
if (CaDvbApi) {
|
||||||
if (!CaDvbApi->Recording()) {
|
if (!CaDvbApi->Recording()) {
|
||||||
if (CaDvbApi->SetChannel(ChannelNumber, FrequencyMHz, Polarization, Diseqc, Srate, Vpid, Apid1, Apid2, Dpid1, Dpid2, Tpid, Ca, Pnr)) {
|
if (CaDvbApi->SetChannel(ChannelNumber, FrequencyMHz, Polarization, Diseqc, Srate, Vpid, Apid1, Apid2, Dpid1, Dpid2, Tpid, Ca, Pnr)) {
|
||||||
usleep(500000); // avoids distortions (apparently switching into replay mode immediately after tuning causes problems)
|
|
||||||
SetModeReplay();
|
SetModeReplay();
|
||||||
transferringFromDvbApi = CaDvbApi->StartTransfer(fd_video);
|
transferringFromDvbApi = CaDvbApi->StartTransfer(fd_video);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fd_video >= 0 && fd_audio >= 0) {
|
if (fd_video >= 0 && fd_audio >= 0) {
|
||||||
CHECK(ioctl(fd_audio, AUDIO_SET_MUTE, false));
|
CHECK(ioctl(fd_audio, AUDIO_SET_MUTE, false));
|
||||||
CHECK(ioctl(fd_video, VIDEO_SET_BLANK, false));
|
CHECK(ioctl(fd_video, VIDEO_SET_BLANK, false));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user