]> git.sesse.net Git - vlc/blobdiff - modules/demux/ts.c
Use var_Inherit* instead of var_CreateGet*.
[vlc] / modules / demux / ts.c
index 3748a5ab0a4d6d9c39589a76fb6368f82a5dc51e..6dccaa11adeb1c70049c4d5821ad73ec3960873b 100644 (file)
@@ -1282,17 +1282,26 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         p_list = (vlc_list_t *)va_arg( args, vlc_list_t * );
         msg_Dbg( p_demux, "DEMUX_SET_GROUP %d %p", i_int, p_list );
 
-        if( i_int > 0 )
+        if( i_int == 0 && p_sys->i_current_program > 0 )
+            i_int = p_sys->i_current_program;
+
+        if( p_sys->i_current_program > 0 )
         {
-            if( i_int != p_sys->i_current_program )
-            {
+            if( p_sys->i_current_program != i_int )
                 SetPrgFilter( p_demux, p_sys->i_current_program, false );
+        }
+        else if( p_sys->i_current_program < 0 )
+        {
+            for( int i = 0; i < p_sys->programs_list.i_count; i++ )
+                SetPrgFilter( p_demux, p_sys->programs_list.p_values[i].i_int, false );
+        }
 
-                p_sys->i_current_program = i_int;
-                SetPrgFilter( p_demux, p_sys->i_current_program, true );
-            }
+        if( i_int > 0 )
+        {
+            p_sys->i_current_program = i_int;
+            SetPrgFilter( p_demux, p_sys->i_current_program, true );
         }
-        else
+        else if( i_int < 0 )
         {
             p_sys->i_current_program = -1;
             p_sys->programs_list.i_count = 0;
@@ -1307,7 +1316,10 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
                 {
                     p_dst->i_count = p_list->i_count;
                     for( int i = 0; i < p_list->i_count; i++ )
+                    {
                         p_dst->p_values[i] = p_list->p_values[i];
+                        SetPrgFilter( p_demux, p_dst->p_values[i].i_int, true );
+                    }
                 }
             }
         }
@@ -3312,7 +3324,7 @@ static void PMTSetupEsTeletext( demux_t *p_demux, ts_pid_t *pid,
     ts_teletext_page_t p_page[2 * 64 + 20];
     unsigned i_page = 0;
 
-    /* Gather pages informations */
+    /* Gather pages information */
 #if defined _DVBPSI_DR_56_H_ && \
     defined DVBPSI_VERSION && DVBPSI_VERSION_INT > ((0<<16)+(1<<8)+5)
     for( unsigned i_tag_idx = 0; i_tag_idx < 2; i_tag_idx++ )
@@ -3830,6 +3842,7 @@ static void PMTParseEsIso639( demux_t *p_demux, ts_pid_t *pid,
     switch( p_decoded->code[0].i_audio_type )
     {
     case 0:
+        pid->es->fmt.i_priority = 1; // prioritize normal audio tracks
         pid->es->fmt.psz_description = NULL;
         break;
     case 1:
@@ -3981,12 +3994,6 @@ static void PMTCallBack( demux_t *p_demux, dvbpsi_pmt_t *p_pmt )
         /* Set demux filter */
         SetPIDFilter( p_demux, prg->i_pid_pcr, true );
     }
-    else
-    {
-        msg_Warn( p_demux, "skipping program (not selected)" );
-        dvbpsi_DeletePMT(p_pmt);
-        return;
-    }
 
     /* Parse descriptor */
     for( p_dr = p_pmt->p_first_descriptor; p_dr != NULL; p_dr = p_dr->p_next )