access: dvb: scan: fix unused scanning parameter b_use_nit
authorFrancois Cartegnie <fcvlcdev@free.fr>
Sun, 10 Apr 2016 12:15:06 +0000 (14:15 +0200)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Mon, 11 Apr 2016 09:09:10 +0000 (11:09 +0200)
modules/access/dvb/access.c
modules/access/dvb/scan.c

index 3d9fc9d..df1f0ab 100644 (file)
@@ -62,6 +62,8 @@ static void Close( vlc_object_t *p_this );
 #define SCANLIST_TEXT N_("Scan tuning list")
 #define SCANLIST_LONGTEXT N_("filename containing initial scan tuning data")
 
+#define SCAN_NIT_TEXT N_("Use NIT for scanning services")
+
 vlc_module_begin ()
     set_shortname( N_("DVB") )
     set_description( N_("DVB input with v4l2 support") )
@@ -74,6 +76,7 @@ vlc_module_begin ()
                 true )
     add_string( "dvb-scanlist", NULL, SCANLIST_TEXT, SCANLIST_LONGTEXT,
                 true )
+    add_bool( "dvb-scan-nit", true, SCAN_NIT_TEXT, NULL, true )
 
     set_capability( "access", 0 )
     add_shortcut( "dvb",                        /* Generic name */
@@ -164,10 +167,13 @@ static int Open( vlc_object_t *p_this )
 
         scan_parameter_Init( &parameter );
 
+        parameter.b_use_nit = var_GetBool( p_access, "dvb-scan-nit" );
+
         msg_Dbg( p_access, "setting filter on PAT/NIT/SDT (DVB only)" );
         FilterSet( p_access, 0x00, OTHER_TYPE );    // PAT
-        FilterSet( p_access, 0x10, OTHER_TYPE );    // NIT
         FilterSet( p_access, 0x11, OTHER_TYPE );    // SDT
+        if( parameter.b_use_nit )
+            FilterSet( p_access, 0x10, OTHER_TYPE );    // NIT
 
         if( FrontendFillScanParameter( p_access, &parameter ) ||
             (p_scan = scan_New( VLC_OBJECT(p_access), &parameter )) == NULL )
index 5fb2974..d13cbec 100644 (file)
@@ -1431,7 +1431,7 @@ bool scan_session_Push( scan_session_t *p_scan, block_t *p_block )
         if( p_scan->p_sdthandle )
             dvbpsi_packet_push( p_scan->p_sdthandle, p_block->p_buffer );
     }
-    else /*if( i_pid == p_scan->i_nit_pid )*/
+    else if( p_scan->b_use_nit ) /*if( i_pid == p_scan->i_nit_pid )*/
     {
         if( !p_scan->p_nithandle )
         {
@@ -1456,7 +1456,8 @@ bool scan_session_Push( scan_session_t *p_scan, block_t *p_block )
 
     block_Release( p_block );
 
-    return p_scan->local.p_pat && p_scan->local.p_sdt && p_scan->local.p_nit;
+    return p_scan->local.p_pat && p_scan->local.p_sdt &&
+            (!p_scan->b_use_nit || p_scan->local.p_nit);
 }
 
 void scan_session_SetSNR( scan_session_t *p_session, int i_snr )