[vlc-devel] RE : [PATCH] -- still image demux

Laurent Aimar fenrir at via.ecp.fr
Fri Jan 9 19:27:58 CET 2009


Hi,

On Fri, Jan 09, 2009, brezhoneg1 wrote:
> Updated version of the still image patch.
> 
> The following syntaxes :
>    vlc fake://image.ext 

>    vlc image.ext
 I do not think this one is wanted.

The fake module will then never terminate. So with a jpeg file inside
a music directory, you will block on the jpeg :(

> are made equivalent to 
>    vlc fake:// :fake-file=image.ext


> -    set_capability( "access_demux", 0 )
> +    set_capability( "access_demux", 100 )
 A lower priority would be better as you are using extension checks.
Maybe something like 10.

> +   /**
> +    * if path is provided, let's see if it could be an image
> +    *   "vlc fake://image.ext" or "vlc image.ext" are made
> +    *   equivalent to a "vlc fake:// :fake-file=image.ext"
> +    *
> +    **/
> +    if( p_demux->psz_path && *p_demux->psz_path )
> +    {
> +        vlc_fourcc_t i_codec = image_Ext2Fourcc( p_demux->psz_path );
> +        if( !i_codec )
> +            return VLC_EGENERIC;

> +        char* p_codec = (char*) &i_codec;
> +        msg_Dbg( p_demux, "still image detected with %c%c%c%c format",
> +                   p_codec[0], p_codec[1], p_codec[2], p_codec[3] );
		
msg_Dbg( p_demux, "still image detected with %4.4s format",
         (const char*)&i_codec );
is better.

> +        vlc_object_t* p_input = p_demux->p_parent;
> +        if( !p_input )
> +            return VLC_EGENERIC;
 Do you really need it ?

> +    
> +        vlc_object_hold( p_input );
 It is useless.

Btw, with an increased priority, you really need to (at least) check that the
provided file exist (using stat).

-- 
fenrir



More information about the vlc-devel mailing list