[FFmpeg-devel] [PATCH 1/2] lavd/v4l2: use avcodec_find_decoder in list_formats

Stefano Sabatini stefasab at gmail.com
Sun Jan 27 23:59:48 CET 2013


On date Sunday 2013-01-27 12:17:39 +0100, Stephan Hilb encoded:
> Because libavdevice/v4l2 is a demuxer, it makes sense to look for
> decoders instead of encoders when listing the formats supported by the
> device.
> ---
>  libavdevice/v4l2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
> index e1efe55..1bf173d 100644
> --- a/libavdevice/v4l2.c
> +++ b/libavdevice/v4l2.c
> @@ -361,7 +361,7 @@ static void list_formats(AVFormatContext *ctx, int fd, int type)
>                     vfd.description);
>          } else if (vfd.flags & V4L2_FMT_FLAG_COMPRESSED &&
>                     type & V4L_COMPFORMATS) {
> -            AVCodec *codec = avcodec_find_encoder(codec_id);
> +            AVCodec *codec = avcodec_find_decoder(codec_id);
>              av_log(ctx, AV_LOG_INFO, "Compressed: %9s : %20s :",
>                     codec ? codec->name : "Unsupported",
>                     vfd.description);

LGTM, gonna push it soon, thanks.
-- 
FFmpeg = Fostering Forgiving Mortal Powered Erotic Gladiator


More information about the ffmpeg-devel mailing list