You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-23 21:54:53 +02:00
prores: call ff_get_format if width and height change
The issue is that hardware decoders may have some state they depend on, which would get broken if the dimensions change.
This commit is contained in:
@@ -185,7 +185,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
|
static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
|
||||||
const int data_size, AVCodecContext *avctx)
|
const int data_size, AVCodecContext *avctx)
|
||||||
{
|
{
|
||||||
int hdr_size, width, height, flags;
|
int hdr_size, width, height, flags, dimensions_changed = 0;
|
||||||
int version;
|
int version;
|
||||||
const uint8_t *ptr;
|
const uint8_t *ptr;
|
||||||
enum AVPixelFormat pix_fmt;
|
enum AVPixelFormat pix_fmt;
|
||||||
@@ -214,6 +214,7 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
|
|||||||
avctx->width, avctx->height, width, height);
|
avctx->width, avctx->height, width, height);
|
||||||
if ((ret = ff_set_dimensions(avctx, width, height)) < 0)
|
if ((ret = ff_set_dimensions(avctx, width, height)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
dimensions_changed = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->frame_type = (buf[12] >> 2) & 3;
|
ctx->frame_type = (buf[12] >> 2) & 3;
|
||||||
@@ -250,7 +251,7 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pix_fmt != ctx->pix_fmt) {
|
if (pix_fmt != ctx->pix_fmt || dimensions_changed) {
|
||||||
#define HWACCEL_MAX (CONFIG_PRORES_VIDEOTOOLBOX_HWACCEL + CONFIG_PRORES_VULKAN_HWACCEL)
|
#define HWACCEL_MAX (CONFIG_PRORES_VIDEOTOOLBOX_HWACCEL + CONFIG_PRORES_VULKAN_HWACCEL)
|
||||||
#if HWACCEL_MAX
|
#if HWACCEL_MAX
|
||||||
enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmtp = pix_fmts;
|
enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmtp = pix_fmts;
|
||||||
|
|||||||
Reference in New Issue
Block a user