Commit 110e4f85 authored by Laurent Aimar's avatar Laurent Aimar

Do not loose pts on stream properties changes.

It closes #2349.
parent 1967b52d
...@@ -285,8 +285,9 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block ) ...@@ -285,8 +285,9 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
if( p_sys->i_rate != p_dec->fmt_out.audio.i_rate ) if( p_sys->i_rate != p_dec->fmt_out.audio.i_rate )
{ {
p_dec->fmt_out.audio.i_rate = p_sys->i_rate; p_dec->fmt_out.audio.i_rate = p_sys->i_rate;
const mtime_t i_end_date = date_Get( &p_sys->end_date );
date_Init( &p_sys->end_date, p_sys->i_rate, 1 ); date_Init( &p_sys->end_date, p_sys->i_rate, 1 );
date_Set( &p_sys->end_date, p_sys->i_pts ); date_Set( &p_sys->end_date, i_end_date );
} }
p_sys->i_state = STATE_NEXT_SYNC; p_sys->i_state = STATE_NEXT_SYNC;
p_sys->i_frame_size = p_sys->b_stream_info && p_sys->stream_info.min_framesize > 0 ? p_sys->i_frame_size = p_sys->b_stream_info && p_sys->stream_info.min_framesize > 0 ?
......
...@@ -302,8 +302,9 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block ) ...@@ -302,8 +302,9 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
msg_Info( p_dec, "MLP channels: %d samplerate: %d", msg_Info( p_dec, "MLP channels: %d samplerate: %d",
p_sys->mlp.i_channels, p_sys->mlp.i_rate ); p_sys->mlp.i_channels, p_sys->mlp.i_rate );
const mtime_t i_end_date = date_Get( &p_sys->end_date );
date_Init( &p_sys->end_date, p_sys->mlp.i_rate, 1 ); date_Init( &p_sys->end_date, p_sys->mlp.i_rate, 1 );
date_Set( &p_sys->end_date, p_sys->i_pts ); date_Set( &p_sys->end_date, i_end_date );
} }
p_dec->fmt_out.audio.i_rate = p_sys->mlp.i_rate; p_dec->fmt_out.audio.i_rate = p_sys->mlp.i_rate;
......
...@@ -1205,8 +1205,9 @@ static void SetupOutput( decoder_t *p_dec, block_t *p_block ) ...@@ -1205,8 +1205,9 @@ static void SetupOutput( decoder_t *p_dec, block_t *p_block )
msg_Info( p_dec, "AAC channels: %d samplerate: %d", msg_Info( p_dec, "AAC channels: %d samplerate: %d",
p_sys->i_channels, p_sys->i_rate ); p_sys->i_channels, p_sys->i_rate );
const mtime_t i_end_date = date_Get( &p_sys->end_date );
date_Init( &p_sys->end_date, p_sys->i_rate, 1 ); date_Init( &p_sys->end_date, p_sys->i_rate, 1 );
date_Set( &p_sys->end_date, p_sys->i_pts ); date_Set( &p_sys->end_date, i_end_date );
} }
p_dec->fmt_out.audio.i_rate = p_sys->i_rate; p_dec->fmt_out.audio.i_rate = p_sys->i_rate;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment