[vlc-commits] MKV: Call ES_OUT_RESET_PCR when ordered chapters force an automatic seek
Denis Charmet
git at videolan.org
Tue Dec 8 10:36:20 CET 2015
vlc | branch: master | Denis Charmet <typx at dinauz.org> | Sat Dec 5 13:50:28 2015 +0100| [bd31be9aeee2a56333561f727fdb81c31d8582b8] | committer: 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: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bd31be9aeee2a56333561f727fdb81c31d8582b8
---
modules/demux/mkv/matroska_segment.cpp | 9 +++------
modules/demux/mkv/virtual_segment.cpp | 3 ++-
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp
index f80239e..f29c580 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -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 */
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,
INT64_C(0) );
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
var_InheritBool( &sys.demuxer, "mkv-use-dummy" ) );
cluster = NULL;
sys.i_start_pts = VLC_TS_0;
- sys.i_pts = VLC_TS_INVALID;
- sys.i_pcr = VLC_TS_0;
+ sys.i_pcr = sys.i_pts = VLC_TS_INVALID;
return;
}
@@ -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*/
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 );
return;
}
@@ -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 )
p_min = p_last;
- sys.i_pcr = 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_pts = p_min->i_mk_date + VLC_TS_0;
+ sys.i_pcr = VLC_TS_INVALID;
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 );
diff --git a/modules/demux/mkv/virtual_segment.cpp b/modules/demux/mkv/virtual_segment.cpp
index 54c65f1..bafd743 100644
--- a/modules/demux/mkv/virtual_segment.cpp
+++ b/modules/demux/mkv/virtual_segment.cpp
@@ -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_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 );
return true;
}
@@ -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 )
ChangeSegment( p_current_chapter->p_segment, p_chapter->p_segment, i_mk_date );
p_current_chapter = p_chapter;
-
p_chapter->p_segment->Seek( i_mk_date, i_mk_time_offset, i_global_position );
}
}
More information about the vlc-commits
mailing list