[vlc-commits] mkv: removed unused/unnecessary argument to functions involved in seek
Filip Roséen
git at videolan.org
Mon May 9 15:09:24 CEST 2016
vlc | branch: master | Filip Roséen <filip at videolabs.io> | Mon May 9 14:52:55 2016 +0200| [194a8b00a07b5e59b30b84065c2562ae090e47de] | committer: Jean-Baptiste Kempf
mkv: removed unused/unnecessary argument to functions involved in seek
The argument is not required, as such it has been removed.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=194a8b00a07b5e59b30b84065c2562ae090e47de
---
modules/demux/mkv/chapter_command.cpp | 2 +-
modules/demux/mkv/demux.cpp | 4 ++--
modules/demux/mkv/matroska_segment.cpp | 37 +-------------------------------
modules/demux/mkv/matroska_segment.hpp | 2 +-
modules/demux/mkv/mkv.cpp | 4 +---
modules/demux/mkv/virtual_segment.cpp | 7 +++---
modules/demux/mkv/virtual_segment.hpp | 3 +--
7 files changed, 10 insertions(+), 49 deletions(-)
diff --git a/modules/demux/mkv/chapter_command.cpp b/modules/demux/mkv/chapter_command.cpp
index adcce3e..0df2ec5 100644
--- a/modules/demux/mkv/chapter_command.cpp
+++ b/modules/demux/mkv/chapter_command.cpp
@@ -726,7 +726,7 @@ bool matroska_script_interpretor_c::Interpret( const binary * p_command, size_t
else
{
if ( !p_vchapter->EnterAndLeave( sys.p_current_vsegment->CurrentChapter() ) )
- p_vsegment->Seek( sys.demuxer, p_vchapter->i_mk_virtual_start_time, p_vchapter, -1 );
+ p_vsegment->Seek( sys.demuxer, p_vchapter->i_mk_virtual_start_time, p_vchapter );
b_result = true;
}
}
diff --git a/modules/demux/mkv/demux.cpp b/modules/demux/mkv/demux.cpp
index ca50504..78ebd61 100644
--- a/modules/demux/mkv/demux.cpp
+++ b/modules/demux/mkv/demux.cpp
@@ -799,7 +799,7 @@ bool demux_sys_t::PreparePlayback( virtual_segment_c & new_vsegment, mtime_t i_m
/* Seek to the beginning */
p_current_vsegment->Seek(p_current_vsegment->CurrentSegment()->sys.demuxer,
- i_mk_date, p_current_vsegment->p_current_vchapter, -1);
+ i_mk_date, p_current_vsegment->p_current_vchapter );
return true;
}
@@ -809,7 +809,7 @@ void demux_sys_t::JumpTo( virtual_segment_c & vsegment, virtual_chapter_c & vcha
if ( !vchapter.p_chapter || !vchapter.p_chapter->Enter( true ) )
{
// jump to the location in the found segment
- vsegment.Seek( demuxer, vchapter.i_mk_virtual_start_time, &vchapter, -1 );
+ vsegment.Seek( demuxer, vchapter.i_mk_virtual_start_time, &vchapter );
}
}
diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp
index 5d34ec3..1d02fb7 100644
--- a/modules/demux/mkv/matroska_segment.cpp
+++ b/modules/demux/mkv/matroska_segment.cpp
@@ -756,7 +756,7 @@ struct spoint
int64_t i_cluster_pos;
};
-void matroska_segment_c::Seek( mtime_t i_mk_date, mtime_t i_mk_time_offset, int64_t i_global_position )
+void matroska_segment_c::Seek( mtime_t i_mk_date, mtime_t i_mk_time_offset )
{
KaxBlock *block;
KaxSimpleBlock *simpleblock;
@@ -771,41 +771,6 @@ void matroska_segment_c::Seek( mtime_t i_mk_date, mtime_t i_mk_time_offset, int6
for( size_t i = 0; i < tracks.size(); i++)
tracks[i]->i_last_dts = VLC_TS_INVALID;
- if( i_global_position >= 0 )
- {
- /* Special case for seeking in files with no cues */
- EbmlElement *el = NULL;
-
- /* Start from the last known index instead of the beginning eachtime */
- if(index_idx() == 0)
- es.I_O().setFilePointer( i_start_pos, seek_beginning );
- else
- es.I_O().setFilePointer( prev_index().i_position,
- seek_beginning );
-
- ep->reconstruct( &es, segment, &sys.demuxer );
- cluster = NULL;
-
- while( ( el = ep->Get() ) != NULL )
- {
- if( MKV_CHECKED_PTR_DECL ( kc_ptr, KaxCluster, el ) )
- {
- cluster = kc_ptr;
- i_cluster_pos = cluster->GetElementPosition();
- if( index_idx() == 0 ||
- ( prev_index().i_position < (int64_t)cluster->GetElementPosition() ) )
- {
- ParseCluster( cluster, false, SCOPE_NO_DATA );
- IndexAppendCluster( cluster );
- }
- if( es.I_O().getFilePointer() >= static_cast<unsigned>( i_global_position ) )
- break;
- }
- }
-
- std::sort( indexes_begin(), indexes_end() );
- }
-
/* Don't try complex seek if we seek to 0 */
if( i_mk_date == 0 && i_mk_time_offset == 0 )
{
diff --git a/modules/demux/mkv/matroska_segment.hpp b/modules/demux/mkv/matroska_segment.hpp
index b19ba03..e86c1af 100644
--- a/modules/demux/mkv/matroska_segment.hpp
+++ b/modules/demux/mkv/matroska_segment.hpp
@@ -135,7 +135,7 @@ public:
bool Preload();
bool PreloadFamily( const matroska_segment_c & segment );
void InformationCreate();
- void Seek( mtime_t i_mk_date, mtime_t i_mk_time_offset, int64_t i_global_position );
+ void Seek( mtime_t i_mk_date, mtime_t i_mk_time_offset );
int BlockGet( KaxBlock * &, KaxSimpleBlock * &, bool *, bool *, int64_t *);
int BlockFindTrackIndex( size_t *pi_track,
diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index f6e29c2..f4756b6 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -443,7 +443,6 @@ static void Seek( demux_t *p_demux, mtime_t i_mk_date, double f_percent, virtual
demux_sys_t *p_sys = p_demux->p_sys;
virtual_segment_c *p_vsegment = p_sys->p_current_vsegment;
matroska_segment_c *p_segment = p_vsegment->CurrentSegment();
- int64_t i_global_position = -1;
if( f_percent < 0 ) msg_Dbg( p_demux, "seek request to i_pos = %" PRId64, i_mk_date );
else msg_Dbg( p_demux, "seek request to %.2f%%", f_percent * 100 );
@@ -496,12 +495,11 @@ static void Seek( demux_t *p_demux, mtime_t i_mk_date, double f_percent, virtual
if( it->i_position < i_pos )
{
msg_Dbg( p_demux, "no cues, seek request to global pos: %" PRId64, i_pos );
- i_global_position = i_pos;
}
}
}
}
- p_vsegment->Seek( *p_demux, i_mk_date, p_vchapter, i_global_position );
+ p_vsegment->Seek( *p_demux, i_mk_date, p_vchapter );
}
/* Needed by matroska_segment::Seek() and Seek */
diff --git a/modules/demux/mkv/virtual_segment.cpp b/modules/demux/mkv/virtual_segment.cpp
index 8c72610..42643f8 100644
--- a/modules/demux/mkv/virtual_segment.cpp
+++ b/modules/demux/mkv/virtual_segment.cpp
@@ -458,7 +458,7 @@ bool virtual_segment_c::UpdateCurrentToChapter( demux_t & demux )
{
/* Forcing reset pcr */
es_out_Control( demux.out, ES_OUT_RESET_PCR);
- Seek( demux, p_cur_vchapter->i_mk_virtual_start_time, p_cur_vchapter, -1 );
+ Seek( demux, p_cur_vchapter->i_mk_virtual_start_time, p_cur_vchapter );
return true;
}
sys.i_start_pts = p_cur_vchapter->i_mk_virtual_start_time + VLC_TS_0;
@@ -508,8 +508,7 @@ bool virtual_chapter_c::EnterAndLeave( virtual_chapter_c *p_leaving_vchapter, bo
return p_chapter->EnterAndLeave( p_leaving_vchapter->p_chapter, b_enter );
}
-void virtual_segment_c::Seek( demux_t & demuxer, mtime_t i_mk_date,
- virtual_chapter_c *p_vchapter, int64_t i_global_position )
+void virtual_segment_c::Seek( demux_t & demuxer, mtime_t i_mk_date, virtual_chapter_c *p_vchapter )
{
demux_sys_t *p_sys = demuxer.p_sys;
@@ -544,7 +543,7 @@ void virtual_segment_c::Seek( demux_t & demuxer, mtime_t i_mk_date,
else
{
p_current_vchapter = p_vchapter;
- p_current_vchapter->segment.Seek( i_mk_date, i_mk_time_offset, i_global_position );
+ p_current_vchapter->segment.Seek( i_mk_date, i_mk_time_offset );
}
}
}
diff --git a/modules/demux/mkv/virtual_segment.hpp b/modules/demux/mkv/virtual_segment.hpp
index 6991e0e..45648d6 100644
--- a/modules/demux/mkv/virtual_segment.hpp
+++ b/modules/demux/mkv/virtual_segment.hpp
@@ -160,8 +160,7 @@ public:
virtual_chapter_c * FindChapter( int64_t i_find_uid );
bool UpdateCurrentToChapter( demux_t & demux );
- void Seek( demux_t & demuxer, mtime_t i_mk_date,
- virtual_chapter_c *p_vchapter, int64_t i_global_position );
+ void Seek( demux_t & demuxer, mtime_t i_mk_date, virtual_chapter_c *p_vchapter );
private:
void KeepTrackSelection( matroska_segment_c & old, matroska_segment_c & next );
};
More information about the vlc-commits
mailing list