Commit cb31dc35 authored by Steve Lhomme's avatar Steve Lhomme

mkv.cpp: clean & fix seeking inside virtual_segment_t

parent 164b14f0
......@@ -1569,11 +1569,12 @@ bool matroska_segment_t::Select( mtime_t i_start_time )
}
sys.i_start_pts = i_start_time;
ep->Reset( &sys.demuxer );
// reset the stream reading to the first cluster of the segment used
es.I_O().setFilePointer( i_start_pos );
delete ep;
ep = new EbmlParser( &es, segment, &sys.demuxer );
return true;
}
......@@ -1591,6 +1592,8 @@ void matroska_segment_t::UnSelect( )
}
#undef tk
}
delete ep;
ep = NULL;
}
bool virtual_segment_t::Select( input_title_t & title )
......@@ -3678,12 +3681,12 @@ void matroska_segment_t::Seek( mtime_t i_date, mtime_t i_time_offset )
msg_Dbg( &sys.demuxer, "seek got "I64Fd" (%d%%)",
i_seek_time, (int)( 100 * i_seek_position / stream_Size( sys.demuxer.s ) ) );
es.I_O().setFilePointer( i_seek_position, seek_beginning );
delete ep;
ep = new EbmlParser( &es, segment, &sys.demuxer );
cluster = NULL;
es.I_O().setFilePointer( i_seek_position, seek_beginning );
sys.i_start_pts = i_date;
es_out_Control( sys.demuxer.out, ES_OUT_RESET_PCR );
......
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