]> git.sesse.net Git - vlc/commitdiff
Commit bis des modifications concernant l'initialisation du continuity
authorBenoit Steiner <benny@videolan.org>
Wed, 8 Dec 1999 21:23:07 +0000 (21:23 +0000)
committerBenoit Steiner <benny@videolan.org>
Wed, 8 Dec 1999 21:23:07 +0000 (21:23 +0000)
counter (ecrasees entre temps)

src/input/input.c
src/input/input_ctrl.c
src/input/input_psi.c

index b5fa1b42d4e164daaae102b065725bdb2b6be058..2d45f9e8130256274026ab424091b10bf7ed72ac 100644 (file)
@@ -705,6 +705,16 @@ static __inline__ void input_DemuxTS( input_thread_t *p_input,
             intf_DbgMsg("Duplicate packet received by TS demux\n");
             b_trash = 1;
         }
+        else if( p_es_descriptor->i_continuity_counter == 0xFF )
+        {
+            /* This means that the packet is the first one we receive for this
+               ES since the continuity counter ranges between 0 and 0x0F
+               excepts when it has been initialized by the input: Init the 
+               counter to the correct value. */
+            intf_DbgMsg("First packet for PID %d received by TS demux\n",
+                        p_es_descriptor->i_id);
+            p_es_descriptor->i_continuity_counter = (p[3] & 0x0f);
+        }
         else
         {
             /* This can indicate that we missed a packet or that the
index d276e7308671c695128ffc8001499fec4b0bbe9b..39e0a96b49e59ed0b7ce50f3940eb8491849e447 100644 (file)
@@ -135,7 +135,7 @@ int input_AddPgrmElem( input_thread_t *p_input, int i_current_id )
 
                 /* Initialise the demux */
                 p_input->p_es[i_es_loop].p_pes_packet = NULL;
-                p_input->p_es[i_es_loop].i_continuity_counter = 0;
+                p_input->p_es[i_es_loop].i_continuity_counter = 0xFF;
                 p_input->p_es[i_es_loop].b_random = 0;
                
                 /* Mark stream to be demultiplexed. */
index 54ac3cc070d9ad0ec534566adadd1be882a97fbe..cea86156a3cb27969854a705506fcd7913d815d9 100644 (file)
@@ -1253,6 +1253,7 @@ static es_descriptor_t* AddESDescr(input_thread_t* p_input,
     p_es->i_type = 0;  /* ??? */
     p_es->b_psi = 0;
     p_es->b_pcr = 0;
+    p_es->i_continuity_counter = 0xFF;
     
     p_es->p_pes_packet = NULL;
 //    p_es->p_next_pes_packet = NULL;