Skip to content
Snippets Groups Projects

demux: mkv: separate Chapter Codec implementations

Merged Steve Lhomme requested to merge robUx4/vlc:codec-split into master
All threads resolved!
1 file
+ 8
18
Compare changes
  • Side-by-side
  • Inline
@@ -42,29 +42,20 @@ chapter_codec_cmds_c::~chapter_codec_cmds_c()
void chapter_codec_cmds_c::AddCommand( const KaxChapterProcessCommand & command )
{
std::optional<MatroskaChapterProcessTime> codec_time;
for( size_t i = 0; i < command.ListSize(); i++ )
{
if( MKV_CHECKED_PTR_DECL_CONST( p_cpt, KaxChapterProcessTime, command[i] ) )
{
codec_time = static_cast<MatroskaChapterProcessTime>( static_cast<unsigned>(*p_cpt) );
break;
}
}
auto codec_time = FindChild<KaxChapterProcessTime>(command);
if( !codec_time )
{
vlc_debug( l, "missing ChapProcessTime" );
return;
}
if( *codec_time >= 3 )
if( static_cast<unsigned>(*codec_time) >= 3 )
{
vlc_debug( l, "unknown ChapProcessTime %d", *codec_time );
vlc_debug( l, "unknown ChapProcessTime %d", static_cast<unsigned>(*codec_time) );
return;
}
ChapterProcess *container;
switch (*codec_time)
switch (static_cast<unsigned>(*codec_time))
{
case MATROSKA_CHAPPROCESSTIME_DURING: container = &during_cmds; break;
case MATROSKA_CHAPPROCESSTIME_BEFORE: container = &enter_cmds; break;
@@ -72,12 +63,11 @@ void chapter_codec_cmds_c::AddCommand( const KaxChapterProcessCommand & command
default: vlc_assert_unreachable();
}
for( size_t i = 0; i < command.ListSize(); i++ )
auto data = FindChild<KaxChapterProcessData>(command);
while (data != nullptr)
{
if( MKV_CHECKED_PTR_DECL_CONST( p_cpd, KaxChapterProcessData, command[i] ) )
{
container->push_back( *p_cpd );
}
container->push_back( *data );
data = FindNextChild<KaxChapterProcessData>(command, *data);
}
}
Loading