[vlc-commits] commit: Fixed the selection of a program list in TS demuxer. ( Laurent Aimar )

git at videolan.org git at videolan.org
Mon Jun 28 21:26:54 CEST 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Jun 28 01:43:51 2010 +0200| [3c1e28fa63be40577a1c678252dc2b51e829f210] | committer: Laurent Aimar 

Fixed the selection of a program list in TS demuxer.

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

 modules/demux/ts.c |   26 +++++++++++++++++++-------
 1 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/modules/demux/ts.c b/modules/demux/ts.c
index 3748a5a..49ff2ea 100644
--- a/modules/demux/ts.c
+++ b/modules/demux/ts.c
@@ -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 );
+                    }
                 }
             }
         }



More information about the vlc-commits mailing list