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

MKV: Call ES_OUT_RESET_PCR when ordered chapters force an automatic seek

Fix #14453 by forcing flush before es_out_Del
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent a627b3ec
...@@ -933,7 +933,6 @@ void matroska_segment_c::Seek( mtime_t i_mk_date, mtime_t i_mk_time_offset, int6 ...@@ -933,7 +933,6 @@ void matroska_segment_c::Seek( mtime_t i_mk_date, mtime_t i_mk_time_offset, int6
/* Don't try complex seek if we seek to 0 */ /* Don't try complex seek if we seek to 0 */
if( i_mk_date == 0 && i_mk_time_offset == 0 ) if( i_mk_date == 0 && i_mk_time_offset == 0 )
{ {
es_out_Control( sys.demuxer.out, ES_OUT_SET_PCR, VLC_TS_0 );
es_out_Control( sys.demuxer.out, ES_OUT_SET_NEXT_DISPLAY_TIME, es_out_Control( sys.demuxer.out, ES_OUT_SET_NEXT_DISPLAY_TIME,
INT64_C(0) ); INT64_C(0) );
es.I_O().setFilePointer( i_start_pos ); es.I_O().setFilePointer( i_start_pos );
...@@ -943,8 +942,7 @@ void matroska_segment_c::Seek( mtime_t i_mk_date, mtime_t i_mk_time_offset, int6 ...@@ -943,8 +942,7 @@ void matroska_segment_c::Seek( mtime_t i_mk_date, mtime_t i_mk_time_offset, int6
var_InheritBool( &sys.demuxer, "mkv-use-dummy" ) ); var_InheritBool( &sys.demuxer, "mkv-use-dummy" ) );
cluster = NULL; cluster = NULL;
sys.i_start_pts = VLC_TS_0; sys.i_start_pts = VLC_TS_0;
sys.i_pts = VLC_TS_INVALID; sys.i_pcr = sys.i_pts = VLC_TS_INVALID;
sys.i_pcr = VLC_TS_0;
return; return;
} }
...@@ -1024,7 +1022,6 @@ void matroska_segment_c::Seek( mtime_t i_mk_date, mtime_t i_mk_time_offset, int6 ...@@ -1024,7 +1022,6 @@ void matroska_segment_c::Seek( mtime_t i_mk_date, mtime_t i_mk_time_offset, int6
/*Neither video nor audio track... no seek further*/ /*Neither video nor audio track... no seek further*/
if( unlikely( !p_first ) ) if( unlikely( !p_first ) )
{ {
es_out_Control( sys.demuxer.out, ES_OUT_SET_PCR, i_mk_date + VLC_TS_0 );
es_out_Control( sys.demuxer.out, ES_OUT_SET_NEXT_DISPLAY_TIME, i_mk_date ); es_out_Control( sys.demuxer.out, ES_OUT_SET_NEXT_DISPLAY_TIME, i_mk_date );
return; return;
} }
...@@ -1101,8 +1098,8 @@ void matroska_segment_c::Seek( mtime_t i_mk_date, mtime_t i_mk_time_offset, int6 ...@@ -1101,8 +1098,8 @@ void matroska_segment_c::Seek( mtime_t i_mk_date, mtime_t i_mk_time_offset, int6
if( p_last->i_mk_date < p_min->i_mk_date ) if( p_last->i_mk_date < p_min->i_mk_date )
p_min = p_last; p_min = p_last;
sys.i_pcr = sys.i_pts = p_min->i_mk_date + VLC_TS_0; sys.i_pts = p_min->i_mk_date + VLC_TS_0;
es_out_Control( sys.demuxer.out, ES_OUT_SET_PCR, sys.i_pcr ); sys.i_pcr = VLC_TS_INVALID;
es_out_Control( sys.demuxer.out, ES_OUT_SET_NEXT_DISPLAY_TIME, i_mk_date ); es_out_Control( sys.demuxer.out, ES_OUT_SET_NEXT_DISPLAY_TIME, i_mk_date );
cluster = (KaxCluster *) ep->UnGet( p_min->i_seek_pos, p_min->i_cluster_pos ); cluster = (KaxCluster *) ep->UnGet( p_min->i_seek_pos, p_min->i_cluster_pos );
......
...@@ -423,6 +423,8 @@ bool virtual_segment_c::UpdateCurrentToChapter( demux_t & demux ) ...@@ -423,6 +423,8 @@ bool virtual_segment_c::UpdateCurrentToChapter( demux_t & demux )
( p_current_chapter && p_current_chapter->p_segment != p_cur_chapter->p_segment ) || ( p_current_chapter && p_current_chapter->p_segment != p_cur_chapter->p_segment ) ||
( p_current_chapter->p_chapter->i_end_time != p_cur_chapter->p_chapter->i_start_time )) ( p_current_chapter->p_chapter->i_end_time != p_cur_chapter->p_chapter->i_start_time ))
{ {
/* Forcing reset pcr */
es_out_Control( demux.out, ES_OUT_RESET_PCR);
Seek( demux, p_cur_chapter->i_mk_virtual_start_time, p_cur_chapter, -1 ); Seek( demux, p_cur_chapter->i_mk_virtual_start_time, p_cur_chapter, -1 );
return true; return true;
} }
...@@ -488,7 +490,6 @@ void virtual_segment_c::Seek( demux_t & demuxer, mtime_t i_mk_date, ...@@ -488,7 +490,6 @@ void virtual_segment_c::Seek( demux_t & demuxer, mtime_t i_mk_date,
if( p_current_chapter->p_segment != p_chapter->p_segment ) if( p_current_chapter->p_segment != p_chapter->p_segment )
ChangeSegment( p_current_chapter->p_segment, p_chapter->p_segment, i_mk_date ); ChangeSegment( p_current_chapter->p_segment, p_chapter->p_segment, i_mk_date );
p_current_chapter = p_chapter; p_current_chapter = p_chapter;
p_chapter->p_segment->Seek( i_mk_date, i_mk_time_offset, i_global_position ); p_chapter->p_segment->Seek( i_mk_date, i_mk_time_offset, i_global_position );
} }
} }
......
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