diff options
author | Anton Khirnov <anton@khirnov.net> | 2016-12-14 13:22:19 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2016-12-19 08:07:15 +0100 |
commit | 0fea8555ae25124c21f4c4f55a5fa76e9169aa03 (patch) | |
tree | acd624b7d713fceb93e9246a440da1d0a1da7afa /libavdevice/v4l2.c | |
parent | ee480790c7eeb03c9cebd8971c46e0cb7db65277 (diff) | |
download | ffmpeg-0fea8555ae25124c21f4c4f55a5fa76e9169aa03.tar.gz |
v4l2: use codec descriptors for mapping a codec name to id
This mapping has nothing to do with decoder implementations, so using
decoder names is wrong.
Diffstat (limited to 'libavdevice/v4l2.c')
-rw-r--r-- | libavdevice/v4l2.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c index 0479121d7d..a8afe8ab58 100644 --- a/libavdevice/v4l2.c +++ b/libavdevice/v4l2.c @@ -771,16 +771,16 @@ static int v4l2_read_header(AVFormatContext *s1) } if (s->pixel_format) { - AVCodec *codec = avcodec_find_decoder_by_name(s->pixel_format); + const AVCodecDescriptor *desc = avcodec_descriptor_get_by_name(s->pixel_format); - if (codec) { - s1->video_codec_id = codec->id; + if (desc) { + s1->video_codec_id = desc->id; st->need_parsing = AVSTREAM_PARSE_HEADERS; } pix_fmt = av_get_pix_fmt(s->pixel_format); - if (pix_fmt == AV_PIX_FMT_NONE && !codec) { + if (pix_fmt == AV_PIX_FMT_NONE && !desc) { av_log(s1, AV_LOG_ERROR, "No such input format: %s.\n", s->pixel_format); |