[vlc-devel] [PATCH] Smem Stream output module

Rafaël Carré rafael.carre at gmail.com
Thu Aug 20 14:08:25 CEST 2009


On Thu, 20 Aug 2009 13:48:17 +0200
christophe courtaut <christophe.courtaut at gmail.com> wrote:

Hi, i have a few small comments

> From d51e0d64fb952f3b5f78c89ea12183dce7231806 Mon Sep 17 00:00:00 2001
> From: Christophe Courtaut <christophe.courtaut at gmail.com>
> Date: Fri, 31 Jul 2009 15:59:09 +0200
> Subject: [PATCH] Functionnal version of smem stream output module

> +    psz_tmp = var_CreateGetString( p_stream, SOUT_PREFIX_VIDEO
> "chroma" );
> +    memcpy( &p_sys->i_video_chroma, psz_tmp, 4 );
> +    free( psz_tmp );

you should use strncpy to check psz_tmp len




> +static void Close( vlc_object_t * p_this ) +{
> +    sout_stream_t *p_stream = (sout_stream_t*)p_this;
> +    if ( p_stream->p_sys->time_sync )
> +        p_stream->p_sout->i_out_pace_nocontrol--;
> +
> +    (void)p_this;

not needed ^

> +}



> +static sout_stream_id_t *AddVideo( sout_stream_t *p_stream,
> es_format_t *p_fmt ) +{
> +    sout_stream_sys_t *p_sys = p_stream->p_sys;
> +
> +    /* Creation of decoder object */
> +
> +    p_sys->p_decoder = vlc_object_create( p_stream,
> VLC_OBJECT_DECODER ); +
> +    if ( !p_sys->p_decoder )
> +        return NULL;
> +
> +    vlc_object_attach( p_sys->p_decoder, p_stream );
> +    p_sys->p_decoder->p_module = NULL;
> +    p_sys->p_decoder->fmt_in = *p_fmt;
> +    p_sys->p_decoder->b_pace_control = false;
> +    p_sys->p_decoder->fmt_out = p_sys->p_decoder->fmt_in;
> +    p_sys->p_decoder->fmt_out.i_extra = 0;

> +    p_sys->p_decoder->fmt_out.p_extra = 0;

it should be NULL because p_extra is a pointer (i know some similar
code use this but it should be fixed as well)


> +static sout_stream_id_t *AddAudio( sout_stream_t *p_stream,
> es_format_t *p_fmt ) +{
> +    VLC_UNUSED( p_stream );
> +    (void)p_fmt;

(void) or VLC_UNUSED() are both ok, (VLC_UNUSED is defined to void) but
please try to use the same ;)



> +/**********************************************************************
> + * Video Buffer Helpers
> +
> **********************************************************************/
> + +inline static picture_t *video_new_buffer_decoder( decoder_t
> *p_dec ) +{

is "inline static" different from "static inline" ?

-- 
Rafaël Carré
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20090820/ece27a1e/attachment.sig>


More information about the vlc-devel mailing list