]> git.sesse.net Git - vlc/blobdiff - modules/codec/mpeg_audio.c
Convert stream to system timestamp after the decoder.
[vlc] / modules / codec / mpeg_audio.c
index 9bb2cc58a41c3c5217aa22c2c1fed03021a26a9c..e5e55f490374c3b52ded734e945d5642f043004d 100644 (file)
@@ -35,7 +35,6 @@
 #include <vlc_plugin.h>
 #include <vlc_codec.h>
 #include <vlc_aout.h>
-#include <vlc_input.h>
 
 #include <vlc_block_helper.h>
 
@@ -68,8 +67,6 @@ struct decoder_sys_t
     unsigned int i_layer, i_bit_rate;
 
     bool   b_discontinuity;
-
-    int i_input_rate;
 };
 
 enum {
@@ -160,7 +157,6 @@ static int OpenDecoder( vlc_object_t *p_this )
     aout_DateSet( &p_sys->end_date, 0 );
     p_sys->bytestream = block_BytestreamInit();
     p_sys->b_discontinuity = false;
-    p_sys->i_input_rate = INPUT_RATE_DEFAULT;
 
     /* Set output properties */
     p_dec->fmt_out.i_cat = AUDIO_ES;
@@ -226,9 +222,6 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
         return NULL;
     }
 
-    if( (*pp_block)->i_rate > 0 )
-        p_sys->i_input_rate = (*pp_block)->i_rate;
-
     block_BytestreamPush( &p_sys->bytestream, *pp_block );
 
     while( 1 )
@@ -545,8 +538,7 @@ static aout_buffer_t *GetAoutBuffer( decoder_t *p_dec )
 
     p_buf->start_date = aout_DateGet( &p_sys->end_date );
     p_buf->end_date =
-        aout_DateIncrement( &p_sys->end_date,
-                            p_sys->i_frame_length * p_sys->i_input_rate / INPUT_RATE_DEFAULT );
+        aout_DateIncrement( &p_sys->end_date, p_sys->i_frame_length );
     p_buf->b_discontinuity = p_sys->b_discontinuity;
     p_sys->b_discontinuity = false;
 
@@ -570,9 +562,7 @@ static block_t *GetSoutBuffer( decoder_t *p_dec )
     p_block->i_pts = p_block->i_dts = aout_DateGet( &p_sys->end_date );
 
     p_block->i_length =
-        aout_DateIncrement( &p_sys->end_date,
-                            p_sys->i_frame_length * p_sys->i_input_rate / INPUT_RATE_DEFAULT ) -
-                                p_block->i_pts;
+        aout_DateIncrement( &p_sys->end_date, p_sys->i_frame_length ) - p_block->i_pts;
 
     return p_block;
 }