]> git.sesse.net Git - vlc/commitdiff
Le continuity_counter du vlc est maintenant initialise automatiquement a
authorBenoit Steiner <benny@videolan.org>
Wed, 8 Dec 1999 00:42:29 +0000 (00:42 +0000)
committerBenoit Steiner <benny@videolan.org>
Wed, 8 Dec 1999 00:42:29 +0000 (00:42 +0000)
la valeur du premier paquet TS que l'input recoit pour chaque PID. On
evite de trasher systematiquement (ou presque) le premier TS de chaque
PID.

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

index efee88b56b9730e75414d10f4e0bebe9b7f3740a..eaf1278bd262492894d487852cfdf7abcd86275b 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
@@ -831,7 +841,7 @@ static __inline__ void input_DemuxPES( input_thread_t *p_input,
                      so the PES won't be usefull for any decoder. Moreover,
                      this should never happen so we can trash the packet and
                      exit roughly without regrets */
-                  intf_DbgMsg("PES packet too short: trashed\n");
+                  intf_DbgMsg("PES packet is too short: trashed\n");
                   input_NetlistFreePES( p_input, p_pes );
                   p_pes = NULL;
                   /* Stats ?? */
index 6dafad703bad4c7027730db356744e9e876ba962..1ce5bb21d0b0909b22d91ee6e99ae850a046b9d1 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 a8e3d0e90b5ae15078890b64d1266848473b6bbd..f883fe7e64330fb53b991baa458d1ef298257d36 100644 (file)
@@ -1167,7 +1167,7 @@ static pgrm_descriptor_t* AddPgrmDescr( stream_descriptor_t* p_stream,
 }
 
 /******************************************************************************
- * AddPgrmDescr: destroy a program descriptor
+ * DestroyPgrmDescr: destroy a program descriptor
  ******************************************************************************
  * All ES descriptions referenced in the descriptor will be deleted.
  ******************************************************************************/
@@ -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;
@@ -1269,7 +1270,7 @@ static es_descriptor_t* AddESDescr(input_thread_t* p_input,
                    i_es_pid, p_pgrm->i_number );
     }
     else
-      intf_DbgMsg( "Added ES %d not added to the definition of any pgrm\n",
+      intf_DbgMsg( "ES %d not added to the definition of any pgrm\n",
                    i_es_pid );
   }