Commit f85f3909 authored by Filip Roséen's avatar Filip Roséen Committed by Jean-Baptiste Kempf

mkv: removed unnecessary dynamic allocation

Replaced the dynamic allocation with an equivalent construction on the
stack (we do not need dynamic life time since it is unconditionally
destroyed at the end of the block).
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent fc393f44
......@@ -1061,22 +1061,19 @@ void matroska_segment_c::EnsureDuration()
// find the last Cluster manually
if ( !i_last_cluster_pos && cluster != NULL )
{
EbmlElement *el;
EbmlParser *ep;
es.I_O().setFilePointer( cluster->GetElementPosition(), seek_beginning );
ep = new EbmlParser( &es , segment, &sys.demuxer,
EbmlElement* el;
EbmlParser ep( &es, segment, &sys.demuxer,
var_InheritBool( &sys.demuxer, "mkv-use-dummy" ) );
while( ( el = ep->Get() ) != NULL )
while( ( el = ep.Get() ) != NULL )
{
if ( MKV_IS_ID( el, KaxCluster ) )
{
i_last_cluster_pos = el->GetElementPosition();
}
}
delete ep;
}
// find the last timecode in the Cluster
......
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