]> git.sesse.net Git - vlc/blobdiff - src/input/decoder.c
Added a new decoder function (decoder_GetDisplayDate) to be used to convert a
[vlc] / src / input / decoder.c
index a384635ac5a6a46ad8a364fcf2072035984a9610..6e81e6ca9b842e36b19886dabb30c1ddc79d8375 100644 (file)
@@ -110,6 +110,12 @@ int decoder_GetInputAttachments( decoder_t *p_dec,
     return input_Control( p_dec->p_owner->p_input, INPUT_GET_ATTACHMENTS,
                           ppp_attachment, pi_attachment );
 }
+/* decoder_GetDisplayDate:
+ */
+mtime_t decoder_GetDisplayDate( decoder_t *p_dec, mtime_t i_ts )
+{
+    return i_ts;
+}
 
 /**
  * Spawns a new decoder thread
@@ -132,7 +138,7 @@ decoder_t *input_DecoderNew( input_thread_t *p_input,
         if( p_dec == NULL )
         {
             msg_Err( p_input, "could not create packetizer" );
-            intf_UserFatal( p_input, VLC_FALSE, _("Streaming / Transcoding failed"), 
+            intf_UserFatal( p_input, VLC_FALSE, _("Streaming / Transcoding failed"),
                             _("VLC could not open the packetizer module.") );
             return NULL;
         }
@@ -144,7 +150,7 @@ decoder_t *input_DecoderNew( input_thread_t *p_input,
         if( p_dec == NULL )
         {
             msg_Err( p_input, "could not create decoder" );
-            intf_UserFatal( p_input, VLC_FALSE, _("Streaming / Transcoding failed"), 
+            intf_UserFatal( p_input, VLC_FALSE, _("Streaming / Transcoding failed"),
                             _("VLC could not open the decoder module.") );
             return NULL;
         }
@@ -252,12 +258,12 @@ void input_DecoderDecode( decoder_t * p_dec, block_t *p_block )
         {
             /* FIXME !!!!! */
             while( !p_dec->b_die && !p_dec->b_error &&
-                   p_dec->p_owner->p_fifo->i_depth > 10 )
+                   block_FifoCount( p_dec->p_owner->p_fifo ) > 10 )
             {
                 msleep( 1000 );
             }
         }
-        else if( p_dec->p_owner->p_fifo->i_size > 50000000 /* 50 MB */ )
+        else if( block_FifoSize( p_dec->p_owner->p_fifo ) > 50000000 /* 50 MB */ )
         {
             /* FIXME: ideally we would check the time amount of data
              * in the fifo instead of its size. */
@@ -302,7 +308,8 @@ void input_DecoderDiscontinuity( decoder_t * p_dec, vlc_bool_t b_flush )
 
 vlc_bool_t input_DecoderEmpty( decoder_t * p_dec )
 {
-    if( p_dec->p_owner->b_own_thread && p_dec->p_owner->p_fifo->i_depth > 0 )
+    if( p_dec->p_owner->b_own_thread
+     && block_FifoCount( p_dec->p_owner->p_fifo ) > 0 )
     {
         return VLC_FALSE;
     }
@@ -789,9 +796,9 @@ static int DecoderDecode( decoder_t *p_dec, block_t *p_block )
  */
 static void DeleteDecoder( decoder_t * p_dec )
 {
-    msg_Dbg( p_dec, "killing decoder fourcc `%4.4s', %d PES in FIFO",
+    msg_Dbg( p_dec, "killing decoder fourcc `%4.4s', %u PES in FIFO",
              (char*)&p_dec->fmt_in.i_codec,
-             p_dec->p_owner->p_fifo->i_depth );
+             (unsigned)block_FifoCount( p_dec->p_owner->p_fifo ) );
 
     /* Free all packets still in the decoder fifo. */
     block_FifoEmpty( p_dec->p_owner->p_fifo );