- /* Creating the sout input if not created yet. */
- if( p_sys->p_sout_input == NULL )
- {
- p_sys->sout_format.i_sample_rate = p_sys->i_rate;
- p_sys->sout_format.i_channels = p_sys->i_channels;
- p_sys->sout_format.i_block_align = 0;
- p_sys->sout_format.i_bitrate = p_sys->i_bit_rate;
- p_sys->sout_format.i_extra_data = 0;
- p_sys->sout_format.p_extra_data = NULL;
-
- aout_DateInit( &p_sys->end_date, p_sys->i_rate );
- aout_DateSet( &p_sys->end_date, p_sys->pts );
-
- p_sys->p_sout_input = sout_InputNew( p_dec, &p_sys->sout_format );
- if( p_sys->p_sout_input == NULL )
- {
- msg_Err( p_dec, "cannot add a new stream" );
- *pp_buffer = NULL;
- return VLC_EGENERIC;
- }
- msg_Info( p_dec, "MPGA channels:%d samplerate:%d bitrate:%d",
- p_sys->i_channels, p_sys->i_rate, p_sys->i_bit_rate );
- }
+ p_buf->i_pts = date_Get( &p_sys->end_date );
+ p_buf->i_length = date_Increment( &p_sys->end_date, p_sys->i_frame_length )
+ - p_buf->i_pts;
+ if( p_sys->b_discontinuity )
+ p_buf->i_flags |= BLOCK_FLAG_DISCONTINUITY;
+ p_sys->b_discontinuity = false;