mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-06-16 04:32:47 +02:00
ffv1dec: call ff_get_format if the EC coding changes
Decoders need to track all state that hwaccels may be intersted in, and trigger a reconfiguration if it changes.
This commit is contained in:
@@ -140,6 +140,7 @@ typedef struct FFV1Context {
|
||||
enum AVPixelFormat pix_fmt;
|
||||
enum AVPixelFormat configured_pix_fmt;
|
||||
int configured_width, configured_height;
|
||||
int configured_ac;
|
||||
|
||||
const AVFrame *cur_enc_frame;
|
||||
int plane_count;
|
||||
|
||||
@@ -509,13 +509,15 @@ static int read_header(FFV1Context *f, RangeCoder *c)
|
||||
|
||||
if (f->configured_pix_fmt != f->pix_fmt ||
|
||||
f->configured_width != f->avctx->width ||
|
||||
f->configured_height != f->avctx->height) {
|
||||
f->configured_height != f->avctx->height ||
|
||||
f->configured_ac != f->ac) {
|
||||
f->avctx->pix_fmt = get_pixel_format(f);
|
||||
if (f->avctx->pix_fmt < 0)
|
||||
return AVERROR(EINVAL);
|
||||
f->configured_pix_fmt = f->pix_fmt;
|
||||
f->configured_width = f->avctx->width;
|
||||
f->configured_height = f->avctx->height;
|
||||
f->configured_ac = f->ac;
|
||||
}
|
||||
|
||||
ff_dlog(f->avctx, "%d %d %d\n",
|
||||
@@ -921,6 +923,7 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
|
||||
fdst->colorspace = fsrc->colorspace;
|
||||
fdst->pix_fmt = fsrc->pix_fmt;
|
||||
fdst->configured_pix_fmt = fsrc->configured_pix_fmt;
|
||||
fdst->configured_ac = fsrc->configured_ac;
|
||||
|
||||
fdst->ec = fsrc->ec;
|
||||
fdst->intra = fsrc->intra;
|
||||
|
||||
Reference in New Issue
Block a user