Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] [patch] configurable lock timeout



Moin,
I have some problems with "newer" vdr versions (newer means: after the lock
timeout has been introduced), because my dvb tuner card often only gets a
lock after 20 seconds.
As also some other people had problems with this, I made a little patch to
make the lock timeout configurable (by setting it to zero, it is disabled
completely, so the receiver thread is attached independent of a detected
lock, which was the behaviour before this timeout was introduced).

-- 
c u
henning
diff -ur vdr-1.3.17/config.c vdr-1.3.17.locktimeout/config.c
--- vdr-1.3.17/config.c	2004-10-31 16:17:39.000000000 +0000
+++ vdr-1.3.17.locktimeout/config.c	2004-12-19 19:07:00.000000000 +0000
@@ -248,6 +248,7 @@
   strcpy(OSDSkin, "sttng");
   strcpy(OSDTheme, "default");
   PrimaryDVB = 1;
+  DVBLockTimeout = 5;
   ShowInfoOnChSwitch = 1;
   MenuScrollPage = 1;
   MarkInstantRecord = 1;
@@ -401,6 +402,7 @@
   else if (!strcasecmp(Name, "OSDSkin"))             strn0cpy(OSDSkin, Value, MaxSkinName);
   else if (!strcasecmp(Name, "OSDTheme"))            strn0cpy(OSDTheme, Value, MaxThemeName);
   else if (!strcasecmp(Name, "PrimaryDVB"))          PrimaryDVB         = atoi(Value);
+  else if (!strcasecmp(Name, "DVBLockTimeout"))      DVBLockTimeout     = atoi(Value);
   else if (!strcasecmp(Name, "ShowInfoOnChSwitch"))  ShowInfoOnChSwitch = atoi(Value);
   else if (!strcasecmp(Name, "MenuScrollPage"))      MenuScrollPage     = atoi(Value);
   else if (!strcasecmp(Name, "MarkInstantRecord"))   MarkInstantRecord  = atoi(Value);
@@ -461,6 +463,7 @@
   Store("OSDSkin",            OSDSkin);
   Store("OSDTheme",           OSDTheme);
   Store("PrimaryDVB",         PrimaryDVB);
+  Store("DVBLockTimeout",     DVBLockTimeout);
   Store("ShowInfoOnChSwitch", ShowInfoOnChSwitch);
   Store("MenuScrollPage",     MenuScrollPage);
   Store("MarkInstantRecord",  MarkInstantRecord);
Only in vdr-1.3.17.locktimeout: config.c.orig
diff -ur vdr-1.3.17/config.h vdr-1.3.17.locktimeout/config.h
--- vdr-1.3.17/config.h	2004-11-16 16:57:43.000000000 +0000
+++ vdr-1.3.17.locktimeout/config.h	2004-12-19 19:07:00.000000000 +0000
@@ -209,6 +209,7 @@
   char OSDSkin[MaxSkinName];
   char OSDTheme[MaxThemeName];
   int PrimaryDVB;
+  int DVBLockTimeout;
   int ShowInfoOnChSwitch;
   int MenuScrollPage;
   int MarkInstantRecord;
Only in vdr-1.3.17.locktimeout: config.h.orig
diff -ur vdr-1.3.17/device.c vdr-1.3.17.locktimeout/device.c
--- vdr-1.3.17/device.c	2004-10-30 14:53:38.000000000 +0000
+++ vdr-1.3.17.locktimeout/device.c	2004-12-19 19:07:00.000000000 +0000
@@ -23,7 +23,6 @@
 
 // The default priority for non-primary devices:
 #define DEFAULTPRIORITY  -1
-#define TUNER_LOCK_TIMEOUT 5000 // ms
 
 int cDevice::numDevices = 0;
 int cDevice::useDevice = 0;
@@ -766,7 +765,7 @@
      return false;
   if (Receiver->device == this)
      return true;
-  if (!HasLock(TUNER_LOCK_TIMEOUT)) {
+  if (!HasLock(Setup.DVBLockTimeout*1000)) {
      esyslog("ERROR: device %d has no lock, can't attach receiver!", CardIndex() + 1);
      return false;
      }
diff -ur vdr-1.3.17/dvbdevice.c vdr-1.3.17.locktimeout/dvbdevice.c
--- vdr-1.3.17/dvbdevice.c	2004-11-20 11:41:37.000000000 +0000
+++ vdr-1.3.17.locktimeout/dvbdevice.c	2004-12-19 19:07:00.000000000 +0000
@@ -819,6 +819,7 @@
 
 bool cDvbDevice::HasLock(int TimeoutMs)
 {
+  if (TimeoutMs==0) return true;
   return dvbTuner ? dvbTuner->Locked(TimeoutMs) : false;
 }
 
diff -ur vdr-1.3.17/menu.c vdr-1.3.17.locktimeout/menu.c
--- vdr-1.3.17/menu.c	2004-11-20 10:49:17.000000000 +0000
+++ vdr-1.3.17.locktimeout/menu.c	2004-12-19 19:07:00.000000000 +0000
@@ -1927,6 +1927,7 @@
 
   SetSection(tr("DVB"));
   Add(new cMenuEditIntItem( tr("Setup.DVB$Primary DVB interface"), &data.PrimaryDVB, 1, cDevice::NumDevices()));
+  Add(new cMenuEditIntItem( tr("Setup.DVB$DVB Lock Timeout (s)"), &data.DVBLockTimeout, 0, 120));
   Add(new cMenuEditBoolItem(tr("Setup.DVB$Video format"),          &data.VideoFormat, "4:3", "16:9"));
   Add(new cMenuEditStraItem(tr("Setup.DVB$Update channels"),       &data.UpdateChannels, 5, updateChannelsTexts));
 }
Only in vdr-1.3.17.locktimeout: menu.c.orig

Home | Main Index | Thread Index