<p>Thanks for the review!</p>
<hr style="height:1px;margin-bottom:20px;background-color:#ddd;color:#ddd" />
<p>On 16/03/14 17:59, Steve Lhomme wrote:</p>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p>LGTM</p>
<p>On Mon, Mar 14, 2016 at 3:06 PM, Filip Roséen <a href="mailto:filip@videolabs.io">filip@videolabs.io</a> wrote:</p>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p>Steve “robux4” Lhomme noticed an error in the code-refactoring that would create a new chapter_translation_c for every subelement found, even though the found subelements should belong to the same chapter_translation_c.</p>
<p>This patch fixes that by introducing a nested dispatch-handler for the EbmlTypes belonging to a KaxChapterTranslate. — modules/demux/mkv/matroska_segment_parse.cpp | 51 ++++++++++++++————– 1 file changed, 26 insertions(+), 25 deletions(-)</p>
<p>diff –git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp index 16e93d6..71dac0d 100644 — a/modules/demux/mkv/matroska_segment_parse.cpp +++ b/modules/demux/mkv/matroska_segment_parse.cpp @@ -810,45 +810,46 @@ void matroska_segment_c::ParseInfo( KaxInfo <em>info ) } E_CASE( KaxChapterTranslate, trans ) { - KaxChapterTranslate </em>p_trans = &trans; + MKV_SWITCH_CREATE( EbmlTypeDispatcher, TranslationHandler, chapter_translation_c* ) + { + MKV_SWITCH_INIT(); + + E_CASE( KaxChapterTranslateEditionUID, uid ) + { + vars->editions.push_back( static_cast<uint64>( uid ) ); + } + E_CASE( KaxChapterTranslateCodec, codec_id ) + { + vars->codec_id = static_cast<uint32>( codec_id ); + } + E_CASE( KaxChapterTranslateID, translated_id ) + { + vars->p_translated = new KaxChapterTranslateID( translated_id ); + } + }; try { - if( unlikely( p_trans->IsFiniteSize() && p_trans->GetSize() >= SIZE_MAX ) ) + if(
unlikely( trans.IsFiniteSize() && trans.GetSize() >= SIZE_MAX ) ) { msg_Err( vars.p_demuxer, “Chapter translate too big, aborting” ); return; }</p>
<ul>
<li><pre><code> p_trans->Read( vars.obj->es, EBML_CONTEXT(p_trans), vars.i_upper_level, vars.el, true );</code></pre></li>
<li><pre><code> trans.Read( vars.obj->es, EBML_CONTEXT(&trans), vars.i_upper_level, vars.el, true );</code></pre></li>
<li></li>
<li><pre><code> chapter_translation_c *p_translate = new chapter_translation_c();</code></pre></li>
<li><pre><code> dispatcher.iterate( p_trans->begin(), p_trans->end(), Payload( vars ) );</code></pre></li>
<li><pre><code> TranslationHandler::Dispatcher().iterate(</code></pre></li>
<li><pre><code> trans.begin(), trans.end(), TranslationHandler::Payload( p_translate )</code></pre></li>
<li><pre><code> );</code></pre></li>
<li></li>
<li><pre><code> vars.obj->translations.push_back( p_translate );
}
catch(...)
{
msg_Err( vars.p_demuxer, "Error while reading Chapter Tranlate");
}
}</code></pre></li>
<li><pre><code> E_CASE( KaxChapterTranslateEditionUID, uid )</code></pre></li>
<li><pre><code> {</code></pre></li>
<li><pre><code> chapter_translation_c *p_translate = new chapter_translation_c();</code></pre></li>
<li><pre><code> p_translate->editions.push_back( static_cast<uint64>( uid ) );</code></pre></li>
<li></li>
<li><pre><code> vars.obj->translations.push_back( p_translate );</code></pre></li>
<li><pre><code> }</code></pre></li>
<li><pre><code> E_CASE( KaxChapterTranslateCodec, codec_id )</code></pre></li>
<li><pre><code> {</code></pre></li>
<li><pre><code> chapter_translation_c *p_translate = new chapter_translation_c();</code></pre></li>
<li><pre><code> p_translate->codec_id = static_cast<uint32>( codec_id );</code></pre></li>
<li></li>
<li><pre><code> vars.obj->translations.push_back( p_translate );</code></pre></li>
<li><pre><code> }</code></pre></li>
<li><pre><code> E_CASE( KaxChapterTranslateID, translated_id )</code></pre></li>
<li><pre><code> {</code></pre></li>
<li><pre><code> chapter_translation_c *p_translate = new chapter_translation_c();</code></pre></li>
<li><pre><code> p_translate->p_translated = new KaxChapterTranslateID( translated_id );</code></pre></li>
<li></li>
<li><pre><code> vars.obj->translations.push_back( p_translate );</code></pre></li>
<li><pre><code> }
E_CASE( EbmlVoid, )
{
VLC_UNUSED( vars );</code></pre>
– 2.7.3</li>
</ul>
<hr style="height:1px;margin-bottom:20px;background-color:#ddd;color:#ddd" />
<p>vlc-devel mailing list To unsubscribe or modify your subscription options: https://mailman.videolan.org/listinfo/vlc-devel _______________________________________________ vlc-devel mailing list To unsubscribe or modify your subscription options: https://mailman.videolan.org/listinfo/vlc-devel</p>
</blockquote>
</blockquote>