]> git.sesse.net Git - vlc/blobdiff - src/input/input_dec.c
* src/input/input_dec.c: Copy block_t::i_flags to sout_buffer_t::i_flags
[vlc] / src / input / input_dec.c
index e6f42f03306842122d78595a3c5db386110b4f48..ca5b6921be06310f841d38d6e50ef12f0bf11af9 100644 (file)
@@ -2,7 +2,7 @@
  * input_dec.c: Functions for the management of decoders
  *****************************************************************************
  * Copyright (C) 1999-2004 VideoLAN
- * $Id: input_dec.c,v 1.90 2004/02/22 16:08:47 fenrir Exp $
+ * $Id: input_dec.c,v 1.93 2004/03/03 11:12:08 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -96,34 +96,17 @@ decoder_t * input_RunDecoder( input_thread_t * p_input, es_descriptor_t * p_es )
     vlc_value_t    val;
 
     /* If we are in sout mode, search for packetizer module */
-    var_Get( p_input, "sout", &val );
-    if( !p_es->b_force_decoder && val.psz_string && *val.psz_string )
+    if( !p_es->b_force_decoder && p_input->stream.p_sout )
     {
-        free( val.psz_string );
-        val.b_bool = VLC_TRUE;
-
-        if( p_es->i_cat == AUDIO_ES )
-        {
-            var_Get( p_input, "sout-audio", &val );
-        }
-        else if( p_es->i_cat == VIDEO_ES )
+        /* Create the decoder configuration structure */
+        p_dec = CreateDecoder( p_input, p_es, VLC_OBJECT_PACKETIZER );
+        if( p_dec == NULL )
         {
-            var_Get( p_input, "sout-video", &val );
+            msg_Err( p_input, "could not create packetizer" );
+            return NULL;
         }
 
-        if( val.b_bool )
-        {
-            /* Create the decoder configuration structure */
-            p_dec = CreateDecoder( p_input, p_es, VLC_OBJECT_PACKETIZER );
-            if( p_dec == NULL )
-            {
-                msg_Err( p_input, "could not create packetizer" );
-                return NULL;
-            }
-
-            p_dec->p_module =
-                module_Need( p_dec, "packetizer", "$packetizer" );
-        }
+        p_dec->p_module = module_Need( p_dec, "packetizer", "$packetizer" );
     }
     else
     {
@@ -137,11 +120,9 @@ decoder_t * input_RunDecoder( input_thread_t * p_input, es_descriptor_t * p_es )
 
         /* default Get a suitable decoder module */
         p_dec->p_module = module_Need( p_dec, "decoder", "$codec" );
-
-        if( val.psz_string ) free( val.psz_string );
     }
 
-    if( !p_dec || !p_dec->p_module )
+    if( !p_dec->p_module )
     {
         msg_Err( p_dec, "no suitable decoder module for fourcc `%4.4s'.\n"
                  "VLC probably does not support this sound or video format.",
@@ -276,7 +257,8 @@ void input_DecodePES( decoder_t * p_dec, pes_packet_t * p_pes )
             }
             p_block->i_pts = p_pes->i_pts;
             p_block->i_dts = p_pes->i_dts;
-            p_block->b_discontinuity = p_pes->b_discontinuity;
+            if( p_pes->b_discontinuity )
+                p_block->i_flags |= BLOCK_FLAG_DISCONTINUITY;
             p_block->i_rate = p_pes->i_rate;
 
             input_DecodeBlock( p_dec, p_block );
@@ -325,7 +307,7 @@ static void input_NullPacket( input_thread_t * p_input,
     if( p_block )
     {
         memset( p_block->p_buffer, 0, PADDING_PACKET_SIZE );
-        p_block->b_discontinuity = 1;
+        p_block->i_flags |= BLOCK_FLAG_DISCONTINUITY;
 
         block_FifoPut( p_es->p_dec->p_owner->p_fifo, p_block );
     }
@@ -627,6 +609,9 @@ static int DecoderDecode( decoder_t *p_dec, block_t *p_block )
                 p_sout_buffer->i_pts = p_sout_block->i_pts;
                 p_sout_buffer->i_dts = p_sout_block->i_dts;
                 p_sout_buffer->i_length = p_sout_block->i_length;
+                p_sout_buffer->i_flags =
+                        (p_sout_block->i_flags << SOUT_BUFFER_FLAGS_BLOCK_SHIFT)
+                          & SOUT_BUFFER_FLAGS_BLOCK_MASK;
 
                 block_Release( p_sout_block );