mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-14 00:58:38 +02:00
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>
This commit is contained in:
commit
a0ffd66caa
@ -884,14 +884,14 @@ static int v4l2_read_header(AVFormatContext *ctx)
|
|||||||
avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
|
avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
|
||||||
|
|
||||||
if (s->pixel_format) {
|
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)
|
if (desc)
|
||||||
ctx->video_codec_id = codec->id;
|
ctx->video_codec_id = desc->id;
|
||||||
|
|
||||||
pix_fmt = av_get_pix_fmt(s->pixel_format);
|
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",
|
av_log(ctx, AV_LOG_ERROR, "No such input format: %s.\n",
|
||||||
s->pixel_format);
|
s->pixel_format);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user