[vlc-devel] [PATCH 2/3] input/decoder.c: fixed code-duplication

Thomas Guillem thomas at gllm.fr
Mon May 23 19:01:08 CEST 2016


 
On Mon, May 23, 2016, at 17:45, Filip Roséen wrote:
> Attached is a patch that circumvents any potential issue by giving
> DecoderDispatchBlock a new argument named b_do_cc which simply toggles
> any potential invocation of DecoderGetCc on/off.
> The pertinent changes compared to the previous patch are below:


> diff --git a/src/input/decoder.c b/src/input/decoder.c index
> d723acf..5e4fbf6 100644 --- a/src/input/decoder.c +++
> b/src/input/decoder.c @@ -1207,7 +1207,7 @@ static void
> DecoderProcessSpu( decoder_t *p_dec, block_t *p_block ) * \param
> pf_decode pointer-to-function responsible for decoding the passed
> block **/ static void DecoderDispatchBlock( decoder_t * p_dec, block_t
> * p_block, -  void( *pf_decode )( decoder_t*, block_t* ) ) +  void(
> *pf_decode )( decoder_t*, block_t* ), bool b_do_cc ) {
> decoder_owner_sys_t *p_owner = p_dec->p_owner;  @@ -1236,7 +1236,7 @@
> static void DecoderDispatchBlock( decoder_t * p_dec, block_t *
> p_block, } }  -            if( p_packetizer->pf_get_cc ) +
> if( b_do_cc && p_packetizer->pf_get_cc ) DecoderGetCc( p_dec,
> p_packetizer );  while( p_packetized_block ) @@ -1289,8 +1289,8 @@
> static void DecoderProcess( decoder_t *p_dec, block_t *p_block )
> switch( p_dec->fmt_out.i_cat ) { -        case VIDEO_ES: return
> DecoderDispatchBlock( p_dec, p_block, &DecoderDecodeVideo ); -
> case AUDIO_ES: return DecoderDispatchBlock( p_dec, p_block,
> &DecoderDecodeAudio ); +        case VIDEO_ES: return
> DecoderDispatchBlock( p_dec, p_block, &DecoderDecodeVideo,  true ); +
> case AUDIO_ES: return DecoderDispatchBlock( p_dec, p_block,
> &DecoderDecodeAudio, false ); case   SPU_ES: return DecoderProcessSpu(
> p_dec, p_block );  default:
> See the attached file for the full patch.
 
OK for me.
 
> _________________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
> Email had 1 attachment:


>  * 0002-input-decoder.c-fixed-code-duplication.patch  8k (text/x-diff)
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20160523/966058fd/attachment.html>


More information about the vlc-devel mailing list