Commit 5a8b5de6 authored by Denis Charmet's avatar Denis Charmet Committed by Jean-Baptiste Kempf

Handle MKV segment change properly

Don't use the var_SetTime hack anymore and don't flush the fifo when
it's not necessary.
Fix #5967 and #2855
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit 87ed819bada9492bc4b2e6e0ff2859797946edf5)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 966bb1d8
......@@ -668,7 +668,7 @@ static int Demux( demux_t *p_demux)
if( p_sys->i_pts >= p_sys->i_start_pts )
if ( p_vsegment->UpdateCurrentToChapter( *p_demux ) )
{
i_return = ( i_block_count != 0 );
i_return = 1;
break;
}
......@@ -694,7 +694,7 @@ static int Demux( demux_t *p_demux)
/* TODO handle successive chapters with the same user_start_time/user_end_time
*/
p_sys->i_pts = p_chap->i_virtual_stop_time;
p_sys->i_start_pts = p_sys->i_pts++; // trick to avoid staying on segments with no duration and no content
p_sys->i_pts++; // trick to avoid staying on segments with no duration and no content
i_return = 1;
}
......@@ -704,7 +704,6 @@ static int Demux( demux_t *p_demux)
else
{
msg_Warn( p_demux, "cannot get block EOF?" );
es_out_Control( p_demux->out, ES_OUT_RESET_PCR );
break;
}
}
......
......@@ -386,8 +386,7 @@ bool virtual_segment_c::UpdateCurrentToChapter( demux_t & demux )
( p_current_chapter->p_chapter->i_end_time != p_cur_chapter->p_chapter->i_start_time ) ||
( p_current_chapter && p_current_chapter->p_segment != p_cur_chapter->p_segment ) )
{
/* hack : we have to use input to seek in order to clean buffers */
var_SetTime( demux.p_sys->p_input, "time", p_cur_chapter->i_virtual_start_time );
Seek( demux, p_cur_chapter->i_virtual_start_time, 0, p_cur_chapter, -1 );
return true;
}
}
......@@ -450,7 +449,6 @@ void virtual_segment_c::Seek( demux_t & demuxer, mtime_t i_date, mtime_t i_time_
if( p_current_chapter->p_segment != p_chapter->p_segment )
{
es_out_Control( demuxer.out, ES_OUT_RESET_PCR );
p_chapter->p_segment->Select( i_date );
p_current_chapter->p_segment->UnSelect();
}
......
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