lavd/v4l2: use avcodec_find_decoder in list_formats

Because libavdevice/v4l2 is a demuxer, it makes sense to look for
decoders instead of encoders when listing the formats supported by the
device.

Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
This commit is contained in:
Stephan Hilb 2013-01-27 12:17:39 +01:00 committed by Stefano Sabatini
parent 4ade824e1f
commit 0501d06468
1 changed files with 1 additions and 1 deletions

View File

@ -360,7 +360,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);