[FFmpeg-devel] [PATCH] initialize avctx->pix_fmt in av1 parser.

James Almer jamrial at gmail.com
Fri Jun 19 17:06:45 EEST 2020


On 6/19/2020 4:01 AM, ManojGuptaBonda wrote:
> Initialize avctx->pix_fmt in av1_parser.c
> AV1 Chroma format is invalid when quering using below code:
> iVideoStream = av_find_best_stream(fmtc, AVMEDIA_TYPE_VIDEO, -1, -1, >
> NULL, 0);
> eChromaFormat = (AVPixelFormat)fmtc->streams[iVideoStream]->codecpar->
>> format;
> ---
>  libavcodec/av1_parser.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavcodec/av1_parser.c b/libavcodec/av1_parser.c
> index 68b7a78abe..16e617ed16 100644
> --- a/libavcodec/av1_parser.c
> +++ b/libavcodec/av1_parser.c
> @@ -164,6 +164,7 @@ static int av1_parser_parse(AVCodecParserContext *ctx,
>          avctx->color_primaries = (enum AVColorPrimaries) color->color_primaries;
>          avctx->color_trc = (enum AVColorTransferCharacteristic) color->transfer_characteristics;
>          avctx->color_range = color->color_range ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG;
> +        avctx->pix_fmt = ctx->format;
>  
>          if (ctx->width != avctx->width || ctx->height != avctx->height) {
>              ret = ff_set_dimensions(avctx, ctx->width, ctx->height);

Applied, thanks.


More information about the ffmpeg-devel mailing list