[vlc-commits] dvb: scan: better check raw scan nit presence

Francois Cartegnie git at videolan.org
Mon May 16 19:36:11 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon May 16 15:53:41 2016 +0200| [1659ee6a0d6fdbacd1339b52b93729a37c6d5c1f] | committer: Francois Cartegnie

dvb: scan: better check raw scan nit presence

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

 modules/access/dvb/scan.c |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/modules/access/dvb/scan.c b/modules/access/dvb/scan.c
index 0f9519f..f18c40f 100644
--- a/modules/access/dvb/scan.c
+++ b/modules/access/dvb/scan.c
@@ -135,6 +135,7 @@ struct scan_t
 
     size_t             i_multiplex;
     scan_multiplex_t **pp_multiplex;
+    bool               b_multiplexes_from_nit;
 
     scan_list_entry_t *p_scanlist;
     size_t             i_scanlist;
@@ -408,6 +409,7 @@ scan_t *scan_New( vlc_object_t *p_obj, const scan_parameter_t *p_parameter,
     p_scan->i_multiplex = 0;
     p_scan->pp_multiplex = NULL;
     p_scan->i_multiplex_toscan = 0;
+    p_scan->b_multiplexes_from_nit = false;
     scan_parameter_Init( &p_scan->parameter );
     scan_parameter_Copy( p_parameter, &p_scan->parameter );
     p_scan->i_time_start = mdate();
@@ -776,10 +778,8 @@ static int Scan_GetNextTunerConfig( scan_t *p_scan, scan_tuner_config_t *p_cfg,
     }
 
     if( p_scan->p_scanlist == NULL &&
-        /* Stop frequency scanning if we found a NIT */
-        ( p_scan->i_multiplex == 0 ||
-          p_scan->pp_multiplex[0]->i_nit_version == UINT8_MAX )
-      )
+        ( p_scan->i_multiplex == 0 || /* Stop frequency scanning if we've found a valid NIT */
+         (p_scan->parameter.b_use_nit && !p_scan->b_multiplexes_from_nit) ) )
     {
         int i_ret = Scan_GetNextSpectrumTunerConfig( p_scan, p_cfg, pf_pos );
         if( i_ret == VLC_SUCCESS )
@@ -1278,8 +1278,14 @@ static void ParseNIT( vlc_object_t *p_obj, scan_t *p_scan,
             }
         }
 
+        bool b_valid = scan_tuner_config_StandardValidate( &tscfg );
+        if( b_valid && p_nit->i_table_id == NIT_CURRENT_NETWORK_TABLE_ID )
+        {
+            p_scan->b_multiplexes_from_nit |= b_valid;
+        }
+
         scan_multiplex_t *p_mplex = scan_FindMultiplex( p_scan, p_ts->i_ts_id );
-        if( p_mplex == NULL && scan_tuner_config_StandardValidate( &tscfg ) )
+        if( p_mplex == NULL && b_valid )
         {
             p_mplex = scan_multiplex_New( &tscfg, p_ts->i_ts_id );
             if( likely(p_mplex) )



More information about the vlc-commits mailing list