From 74b2bcef2a7c9576a4c841d8a1d256cb59f4acc1 Mon Sep 17 00:00:00 2001 From: Lars Hanisch Date: Wed, 17 Mar 2010 20:12:36 +0100 Subject: Add optional sleep after call of externchannelswitch.sh Some cards like the HD PVR needs some time to stabilize the video stream. On some installations a sleep in the external script doesn't seem to work. --- README | 1 + device.c | 5 +++++ pvrinput.c | 1 + setup.c | 1 + setup.h | 1 + 5 files changed, 9 insertions(+) diff --git a/README b/README index be6659a..14eff92 100644 --- a/README +++ b/README @@ -331,6 +331,7 @@ pvrinput.StreamType = 0 //V4L2_MPEG_STREAM_TYPE_MPEG2_PS pvrinput.TunerAudioMode = 4 //bilingual pvrinput.UseOnlyCard = 8 //use all cards pvrinput.UseExternChannelSwitchScript = 0 //don't call externchannelswitch.sh +pvrinput.ExternChannelSwitchSleep = 0 //sleep x seconds after call of externchannelswitch.sh pvrinput.VideoBitrateTV = 6000 //6 MBit/s Using filters may increase the picture quality, but the default value of 8 diff --git a/device.c b/device.c index 646bb1c..998ef48 100644 --- a/device.c +++ b/device.c @@ -1064,6 +1064,11 @@ bool cPvrDevice::OpenDvr(void) { log(pvrERROR, "OpenDvr: executing %s failed", *cmd); } log(pvrDEBUG1, "OpenDvr: returned from %s", *cmd); + if (PvrSetup.ExternChannelSwitchSleep > 0) { + log(pvrDEBUG2, "OpenDvr: sleeping for %d seconds...", PvrSetup.ExternChannelSwitchSleep); + usleep(PvrSetup.ExternChannelSwitchSleep * 1000000); + log(pvrDEBUG2, "OpenDvr: waking up"); + } } if (! SetInput(newInput)) return false; diff --git a/pvrinput.c b/pvrinput.c index 1d66d4c..be56ebc 100644 --- a/pvrinput.c +++ b/pvrinput.c @@ -121,6 +121,7 @@ bool cPluginPvrInput::SetupParse(const char * Name, const char * Value) { else if (!strcasecmp(Name, "TsBufferSizeMB")) PvrSetup.TsBufferSizeMB = atoi(Value); else if (!strcasecmp(Name, "TsBufferPrefillRatio")) PvrSetup.TsBufferPrefillRatio = atoi(Value); else if (!strcasecmp(Name, "UseExternChannelSwitchScript")) PvrSetup.UseExternChannelSwitchScript = atoi(Value); + else if (!strcasecmp(Name, "ExternChannelSwitchSleep")) PvrSetup.ExternChannelSwitchSleep = atoi(Value); else if (!strcasecmp(Name, "HDPVR_AudioEncoding")) PvrSetup.HDPVR_AudioEncoding.value = atoi(Value) + 3; else if (!strcasecmp(Name, "HDPVR_AudioInput")) PvrSetup.HDPVR_AudioInput = atoi(Value); else diff --git a/setup.c b/setup.c index 3019fa1..dc1e1a1 100644 --- a/setup.c +++ b/setup.c @@ -9,6 +9,7 @@ cPvrSetup::cPvrSetup(void) { AudioVolumeTVExceptionCard = 8; // AudioVolumeTVCommon for all cards SliceVBI = 1; // Slice VBI data into mpeg stream UseExternChannelSwitchScript = 0; // don't call externchannelswitch.sh on external inputs + ExternChannelSwitchSleep = 0; // sleep x seconds after call of externchannelswitch.sh TsBufferSizeMB = 3; // ring buffer size TsBufferPrefillRatio = 0; // wait with delivering packets to vdr till buffer is filled /* first initialization of all v4l2 controls, diff --git a/setup.h b/setup.h index 1ba2dd1..d1a746e 100644 --- a/setup.h +++ b/setup.h @@ -19,6 +19,7 @@ public: int SliceVBI; int AudioVolumeTVExceptionCard; int UseExternChannelSwitchScript; + int ExternChannelSwitchSleep; int TsBufferSizeMB; int TsBufferPrefillRatio; valSet Brightness; -- cgit v1.2.3