? autom4te-2.53.cache
? build.log
? error.log
? error.log.backup
? include_stream_output.h.diff
? modules_mux_mpeg_ts.diff
? ts_discontinuity.diff
? vlc.kdevprj
? vlc.kdevses
? modules/demux/aac/.deps
? modules/demux/aac/Makefile
? modules/demux/aac/Makefile.am
? modules/demux/aac/Makefile.in
? modules/demux/wav/.deps
? modules/demux/wav/Makefile
? modules/demux/wav/Makefile.am
? modules/demux/wav/Makefile.in
? modules/gui/pda/interface.c.jps
? modules/gui/win32/Makefile
? modules/gui/win32/Makefile.am
? modules/gui/win32/Makefile.in
Index: include/stream_output.h
===================================================================
RCS file: /var/cvs/videolan/vlc/include/stream_output.h,v
retrieving revision 1.12
diff -u -r1.12 stream_output.h
--- include/stream_output.h	9 Aug 2003 14:59:24 -0000	1.12
+++ include/stream_output.h	14 Aug 2003 15:10:08 -0000
@@ -58,6 +58,8 @@
     mtime_t                 i_dts;
     mtime_t                 i_pts;
 
+    vlc_bool_t              b_discontinuity;
+    
     uint32_t                i_flags;
     int                     i_bitrate;
 
Index: modules/access/dvb/access.c
===================================================================
RCS file: /var/cvs/videolan/vlc/modules/access/dvb/access.c,v
retrieving revision 1.6
diff -u -r1.6 access.c
--- modules/access/dvb/access.c	12 Aug 2003 15:35:26 -0000	1.6
+++ modules/access/dvb/access.c	14 Aug 2003 15:10:08 -0000
@@ -486,7 +486,7 @@
     unsigned int u_video_type = 1; /* default video type */
     unsigned int u_audio_type = 2; /* default audio type */
 
-    // Get adapter and device number to use for this dvb card
+    /* Get adapter and device number to use for this dvb card */
     u_adapter = config_GetInt( p_input, "adapter" );
     u_device  = config_GetInt( p_input, "device" );
 
@@ -501,7 +501,7 @@
             {
                 input_UnselectES( p_input , p_es );
             }
-            if ( p_es->i_demux_fd )
+            if ( p_es->i_demux_fd > 0)
             {
                 ioctl_UnsetDMXFilter(p_input, p_es->i_demux_fd );
                 p_es->i_demux_fd = 0;
Index: modules/demux/mpeg/system.c
===================================================================
RCS file: /var/cvs/videolan/vlc/modules/demux/mpeg/system.c,v
retrieving revision 1.16
diff -u -r1.16 system.c
--- modules/demux/mpeg/system.c	13 Jul 2003 12:35:13 -0000	1.16
+++ modules/demux/mpeg/system.c	14 Aug 2003 15:10:09 -0000
@@ -1262,7 +1262,6 @@
         p_es->c_packets++;
 
         /* Extract adaptation field information if any */
-
         if( !b_adaptation )
         {
             /* We don't have any adaptation_field, so payload starts
@@ -1311,7 +1310,9 @@
                             i_pid,
                             ( p_es_demux->i_continuity_counter ) & 0x0f,
                             p[3] & 0x0f );
-
+                        
+                        p_es_demux->b_discontinuity = VLC_TRUE;
+                            
                         /* If the PID carries the PCR, there will be a system
                          * time-based discontinuity. We let the PCR decoder
                          * handle that. */
Index: modules/demux/mpeg/system.h
===================================================================
RCS file: /var/cvs/videolan/vlc/modules/demux/mpeg/system.h,v
retrieving revision 1.8
diff -u -r1.8 system.h
--- modules/demux/mpeg/system.h	13 Jul 2003 12:35:13 -0000	1.8
+++ modules/demux/mpeg/system.h	14 Aug 2003 15:10:09 -0000
@@ -238,7 +238,8 @@
 
     /* Markers */
     int                     i_continuity_counter;
-
+    vlc_bool_t              b_discontinuity;
+    
     /* mpeg4 in TS data specific */
     int                     b_mpeg4;
     uint16_t                i_es_id;
Index: modules/mux/mpeg/ts.c
===================================================================
RCS file: /var/cvs/videolan/vlc/modules/mux/mpeg/ts.c,v
retrieving revision 1.26
diff -u -r1.26 ts.c
--- modules/mux/mpeg/ts.c	10 Aug 2003 14:23:15 -0000	1.26
+++ modules/mux/mpeg/ts.c	14 Aug 2003 15:10:09 -0000
@@ -150,6 +150,7 @@
     int             i_stream_type;
     int             i_stream_id;
     int             i_continuity_counter;
+    vlc_bool_t      b_discontinuity;
 
     /* to be used for carriege of DIV3 */
     vlc_fourcc_t    i_bih_codec;
@@ -614,7 +615,7 @@
 
     sout_input_t    *p_pcr_input = p_sys->p_pcr_input;
     ts_stream_t     *p_pcr_stream = (ts_stream_t*)p_sys->p_pcr_input->p_sys;
-
+                     
     if( p_sys->i_pcr_pid == 0x1fff )
     {
         msg_Dbg( p_mux, "waiting PCR streams" );
@@ -974,7 +975,7 @@
 
         b_new_pes = VLC_FALSE;
         p_stream->i_continuity_counter = (p_stream->i_continuity_counter+1)%16;
-
+        
         if( b_adaptation_field )
         {
             int i;
@@ -986,6 +987,12 @@
 
                 p_ts->p_buffer[4] = 7 + i_stuffing;
                 p_ts->p_buffer[5] = 0x10;   /* flags */
+                /* Add the discontinuity flag at the TS level */
+                if (p_pes->b_discontinuity)
+                {
+                    p_stream->b_discontinuity = VLC_TRUE;
+                    p_ts->p_buffer[5] != 0x80;
+                }
                 p_ts->p_buffer[6] = ( i_pcr >> 25 )&0xff;
                 p_ts->p_buffer[7] = ( i_pcr >> 17 )&0xff;
                 p_ts->p_buffer[8] = ( i_pcr >> 9  )&0xff;
@@ -1007,6 +1014,13 @@
                 if( i_stuffing > 1 )
                 {
                     p_ts->p_buffer[5] = 0x00;
+                    /* Add the discontinuity flag at the TS level */
+                    if (p_pes->b_discontinuity)
+                    {
+                        p_stream->b_discontinuity = VLC_TRUE;
+                        p_ts->p_buffer[5] != 0x80;
+                    }
+
                     for( i = 6; i < 6 + i_stuffing - 2; i++ )
                     {
                         p_ts->p_buffer[i] = 0xff;
