<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<ul>
<li><pre><code>     if( p_packetizer->pf_get_cc )</code></pre></li>
<li><pre><code>         DecoderGetCc( p_dec, p_packetizer );</code></pre></li>
</ul>
</blockquote>
<p>You forgot DecoderGetCc that is done only for Video. I don’t know if it can be done for audio too.</p>
</blockquote>
<p>Oh my, that was indeed very stupid of me; thanks! <code>p_packetizer->pf_get_cc</code> should be NULL for audio, given that it is initialized to such in LoadDecoder, and grepping for “pf_get_cc” in modules/ yields:</p>
<pre><code>modules/stream_out/transcode/video.c:    id->p_decoder->pf_get_cc = NULL;
modules/codec/libmpeg2.c:    p_dec->pf_get_cc = GetCc;
modules/packetizer/h264.c:    p_dec->pf_get_cc = GetCc;
modules/packetizer/mpegvideo.c:    p_dec->pf_get_cc = GetCc;
modules/packetizer/vc1.c:    p_dec->pf_get_cc = GetCc;</code></pre>
<p>However, this might be beyond my scope of knowledge at the current time, so if this is potentially a breaking change (checkinf p_packetizer->pf_get_cc even if the decoder is for audi).. well, then this patch certainly should not apply at all.</p>
<p>And a refactor that stills removes the code duplication might not be worth the removal of the code-duplication (as such would add complexity).</p>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p>Maybe put p_dec as the first argument (because every DecoderFoo use a decoder_t as a first arg)?</p>
</blockquote>
<p>Very good point, see attached patch that address both issues you noted.</p>
<p>Thanks!</p>