[vlc-devel] [PATCH] image: defer to avformat for BMP

Rémi Denis-Courmont remi at remlab.net
Fri Nov 13 15:39:43 CET 2015


Le 2015-11-13 17:36, Tristan Matthews a écrit :
> "Fixes" broken BMP demuxing.
> ---
>  modules/demux/image.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/modules/demux/image.c b/modules/demux/image.c
> index 43c4847..c62cf48 100644
> --- a/modules/demux/image.c
> +++ b/modules/demux/image.c
> @@ -33,6 +33,7 @@
>  #include <vlc_plugin.h>
>  #include <vlc_demux.h>
>  #include <vlc_image.h>
> +#include <vlc_modules.h>
>  #include "mxpeg_helper.h"
>
>
> 
> /*****************************************************************************
> @@ -631,9 +632,13 @@ static int Open(vlc_object_t *object)
>      msg_Dbg(demux, "Detected image: %s",
>              vlc_fourcc_GetDescription(VIDEO_ES, img->codec));
>
> -    if( img->codec == VLC_CODEC_MXPEG )
> -    {
> -        return VLC_EGENERIC; //let avformat demux this file
> +    /* Let avformat demux this file */
> +    if ( module_exists( "avformat" ) ) {
> +        switch ( img->codec ) {
> +        case VLC_CODEC_MXPEG:
> +        case VLC_CODEC_BMP:
> +            return VLC_EGENERIC;
> +        }
>      }

Bikeshed: for perf reasons, I would invert switch and if.

>
>      /* Load and if selected decode */

-- 
Rémi Denis-Courmont
http://www.remlab.net/


More information about the vlc-devel mailing list