Commit b9188c54 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Rémi Duraffort

MKV: Use new vlc_delete_all to clear containers.

Signed-off-by: default avatarRémi Duraffort <ivoire@videolan.org>
parent a1a0cafb
......@@ -28,18 +28,8 @@
chapter_item_c::~chapter_item_c()
{
std::vector<chapter_codec_cmds_c*>::iterator index = codecs.begin();
while ( index != codecs.end() )
{
delete (*index);
++index;
}
std::vector<chapter_item_c*>::iterator index_ = sub_chapters.begin();
while ( index_ != sub_chapters.end() )
{
delete (*index_);
++index_;
}
vlc_delete_all( codecs );
vlc_delete_all( sub_chapters );
}
int chapter_item_c::PublishChapters( input_title_t & title, int & i_user_chapters, int i_level )
......@@ -93,7 +83,7 @@ chapter_item_c *chapter_item_c::BrowseCodecPrivate( unsigned int codec_id,
return this;
++index;
}
// sub-chapters
chapter_item_c *p_result = NULL;
std::vector<chapter_item_c*>::const_iterator index2 = sub_chapters.begin();
......@@ -104,7 +94,7 @@ chapter_item_c *chapter_item_c::BrowseCodecPrivate( unsigned int codec_id,
return p_result;
++index2;
}
return p_result;
}
......@@ -183,7 +173,7 @@ int16 chapter_item_c::GetTitleNumber( ) const
int64_t chapter_item_c::RefreshChapters( bool b_ordered, int64_t i_prev_user_time )
{
int64_t i_user_time = i_prev_user_time;
// first the sub-chapters, and then ourself
std::vector<chapter_item_c*>::iterator index = sub_chapters.begin();
while ( index != sub_chapters.end() )
......@@ -245,7 +235,7 @@ chapter_item_c *chapter_item_c::FindTimecode( mtime_t i_user_timecode, const cha
psz_result = (*index)->FindTimecode( i_user_timecode, p_current, b_found );
++index;
}
if ( psz_result == NULL )
psz_result = this;
}
......@@ -379,14 +369,14 @@ void chapter_edition_c::RefreshChapters( )
mtime_t chapter_edition_c::Duration() const
{
mtime_t i_result = 0;
if ( sub_chapters.size() )
{
std::vector<chapter_item_c*>::const_iterator index = sub_chapters.end();
--index;
i_result = (*index)->i_user_end_time;
}
return i_result;
}
......
......@@ -66,24 +66,9 @@ matroska_segment_c::~matroska_segment_c()
delete p_prev_segment_uid;
delete p_next_segment_uid;
std::vector<chapter_edition_c*>::iterator index = stored_editions.begin();
while ( index != stored_editions.end() )
{
delete (*index);
++index;
}
std::vector<chapter_translation_c*>::iterator indext = translations.begin();
while ( indext != translations.end() )
{
delete (*indext);
++indext;
}
std::vector<KaxSegmentFamily*>::iterator indexf = families.begin();
while ( indexf != families.end() )
{
delete (*indexf);
++indexf;
}
vlc_delete_all( stored_editions );
vlc_delete_all( translations );
vlc_delete_all( families );
}
......@@ -890,7 +875,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
p[8] == 'R' && p[9] == 'V' &&
(p[10] == '3' || p[10] == '4') && p[11] == '0' )
{
p_tk->fmt.video.i_frame_rate =
p_tk->fmt.video.i_frame_rate =
p[22] << 24 | p[23] << 16 | p[24] << 8 | p[25] << 0;
p_tk->fmt.video.i_frame_rate_base = 65536;
}
......@@ -1091,7 +1076,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
p_fmt->i_codec = VLC_CODEC_TTA;
if( p_tk->i_extra_data > 0 )
{
fill_extra_data( p_tk, 0 );
fill_extra_data( p_tk, 0 );
}
else
{
......
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