[vlc-devel] commit: dvb-c: check symbol-rate limits from frontend (Ilkka Ollakka )

git version control git at videolan.org
Thu Jul 30 13:07:39 CEST 2009


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Thu Jul 30 13:55:18 2009 +0300| [e5c082d7a752bc7c17f037c206a5fb3ac33cbb47] | committer: Ilkka Ollakka 

dvb-c: check symbol-rate limits from frontend

default symbol-rate is suited to dvb-s and is over limits for dvb-c, so
check given symbol-rate and default to somewhat common value if so.

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

 modules/access/dvb/linux_dvb.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/modules/access/dvb/linux_dvb.c b/modules/access/dvb/linux_dvb.c
index ca82f84..f7a5876 100644
--- a/modules/access/dvb/linux_dvb.c
+++ b/modules/access/dvb/linux_dvb.c
@@ -1107,6 +1107,7 @@ static int FrontendSetQPSK( access_t *p_access )
 static int FrontendSetQAM( access_t *p_access )
 {
     access_sys_t *p_sys = p_access->p_sys;
+    frontend_t *p_frontend = p_sys->p_frontend;
     struct dvb_frontend_parameters fep;
     vlc_value_t val;
     int i_ret;
@@ -1118,8 +1119,16 @@ static int FrontendSetQAM( access_t *p_access )
 
     fep.inversion = DecodeInversion( p_access );
 
+    /* Default symbol-rate is for dvb-s, and doesn't fit
+     * for dvb-c, so if it's over the limit of frontend, default to
+     * somewhat common value
+     */
     var_Get( p_access, "dvb-srate", &val );
-    fep.u.qam.symbol_rate = val.i_int;
+    if( val.i_int < p_frontend->info.symbol_rate_max &&
+        val.i_int > p_frontend->info.symbol_rate_min )
+        fep.u.qam.symbol_rate = val.i_int;
+    else
+        fep.u.qam.symbol_rate = 6875000;
 
     var_Get( p_access, "dvb-fec", &val );
     fep.u.qam.fec_inner = DecodeFEC( p_access, val.i_int );




More information about the vlc-devel mailing list