]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/av1_parser: initialize avctx->pix_fmt
authorManoj Bonda <mbonda@nvidia.com>
Fri, 19 Jun 2020 07:01:22 +0000 (12:31 +0530)
committerJames Almer <jamrial@gmail.com>
Fri, 19 Jun 2020 14:05:30 +0000 (11:05 -0300)
Initialize avctx->pix_fmt in av1_parser.c
AV1 Chroma format is invalid when quering using below code if no AV1 decoder
is available:

iVideoStream = av_find_best_stream(fmtc, AVMEDIA_TYPE_VIDEO, -1, -1, NULL, 0);
eChromaFormat = (AVPixelFormat)fmtc->streams[iVideoStream]->codecpar->format;

Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/av1_parser.c

index c5bdc6b25ffbab5c0307a4f0e387ec8969603003..036ab5e14e8f2bece573fcf08b4d5038cde237a8 100644 (file)
@@ -171,6 +171,8 @@ static int av1_parser_parse(AVCodecParserContext *ctx,
         color->transfer_characteristics  == AVCOL_TRC_IEC61966_2_1)
         ctx->format = pix_fmts_rgb[color->high_bitdepth + color->twelve_bit];
 
+    avctx->pix_fmt = ctx->format;
+
     avctx->profile = seq->seq_profile;
     avctx->level   = seq->seq_level_idx[0];