[vlc-commits] DTV: poll signal strength and noise ratio every so often

Rémi Denis-Courmont git at videolan.org
Thu Nov 10 17:58:35 CET 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Nov 10 18:58:13 2011 +0200| [71e0080e74522c9d750c55e07040e715d2d6c95f] | committer: Rémi Denis-Courmont

DTV: poll signal strength and noise ratio every so often

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=71e0080e74522c9d750c55e07040e715d2d6c95f
---

 modules/access/dtv/access.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/modules/access/dtv/access.c b/modules/access/dtv/access.c
index 7d048bf..e2fdc16 100644
--- a/modules/access/dtv/access.c
+++ b/modules/access/dtv/access.c
@@ -26,6 +26,7 @@
 
 #include <vlc_common.h>
 #include <vlc_access.h>
+#include <vlc_input.h>
 #include <vlc_plugin.h>
 #include <vlc_dialog.h>
 #include <search.h>
@@ -394,6 +395,7 @@ vlc_module_end ()
 struct access_sys_t
 {
     dvb_device_t *dev;
+    uint8_t signal_poll;
 };
 
 typedef struct delsys
@@ -429,6 +431,7 @@ static int Open (vlc_object_t *obj)
     }
 
     sys->dev = dev;
+    sys->signal_poll = 0;
     access->p_sys = sys;
 
     uint64_t freq = var_InheritFrequency (obj);
@@ -490,6 +493,12 @@ static block_t *Read (access_t *access)
     }
 
     block->i_buffer = val;
+
+    /* Fetch the signal levels every so often. Some devices do not like this
+     * to be requested too frequently, e.g. due to low bandwidth I²C bus. */
+    if ((sys->signal_poll++) == 0)
+        access->info.i_update |= INPUT_UPDATE_SIGNAL;
+
     return block;
 }
 



More information about the vlc-commits mailing list