Commit a0ffd66c authored by Clément Bœsch's avatar Clément Bœsch

Merge commit '0fea8555'

* commit '0fea8555':
  v4l2: use codec descriptors for mapping a codec name to id
Merged-by: 's avatarClément Bœsch <u@pkh.me>
parents 7e503828 0fea8555
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment