aboutsummaryrefslogtreecommitdiffstats
path: root/libavdevice/v4l2.c
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2017-04-26 17:17:50 +0200
committerClément Bœsch <u@pkh.me>2017-04-26 17:17:50 +0200
commita0ffd66caaae1bff1abebffb36e135abcc8122e6 (patch)
tree8cf0ee1be6fb39c8336451c5a6c4366f4c008f11 /libavdevice/v4l2.c
parent7e503828b03804f90733c306154c293cbd15102e (diff)
parent0fea8555ae25124c21f4c4f55a5fa76e9169aa03 (diff)
downloadffmpeg-a0ffd66caaae1bff1abebffb36e135abcc8122e6.tar.gz
Merge commit '0fea8555ae25124c21f4c4f55a5fa76e9169aa03'
* commit '0fea8555ae25124c21f4c4f55a5fa76e9169aa03': v4l2: use codec descriptors for mapping a codec name to id Merged-by: Clément Bœsch <u@pkh.me>
Diffstat (limited to 'libavdevice/v4l2.c')
-rw-r--r--libavdevice/v4l2.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 15629755a1..17451cdb60 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -884,14 +884,14 @@ static int v4l2_read_header(AVFormatContext *ctx)
avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
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)
- ctx->video_codec_id = codec->id;
+ if (desc)
+ ctx->video_codec_id = desc->id;
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(ctx, AV_LOG_ERROR, "No such input format: %s.\n",
s->pixel_format);