fftools/ffmpeg_dec: pass AVCodec through DecoderOpts

Do not retrieve it from InputStream directly.

This is a step towards decoupling Decoder and InputStream.
This commit is contained in:
Anton Khirnov 2024-01-23 18:42:20 +01:00
parent d5f9ef766b
commit b3d1916ba0
3 changed files with 5 additions and 1 deletions

View File

@ -297,6 +297,8 @@ typedef struct DecoderOpts {
char *name;
const AVCodec *codec;
/* hwaccel options */
enum HWAccelID hwaccel_id;
enum AVHWDeviceType hwaccel_device_type;

View File

@ -951,7 +951,7 @@ int dec_open(InputStream *ist, Scheduler *sch, unsigned sch_idx,
AVDictionary **dec_opts, const DecoderOpts *o)
{
DecoderPriv *dp;
const AVCodec *codec = ist->dec;
const AVCodec *codec = o->codec;
int ret;
ret = dec_alloc(&ist->decoder);

View File

@ -930,6 +930,8 @@ static int ist_use(InputStream *ist, int decoding_needed)
snprintf(ds->dec_name, sizeof(ds->dec_name), "%d:%d", ist->file->index, ist->index);
ds->dec_opts.name = ds->dec_name;
ds->dec_opts.codec = ist->dec;
ret = dec_open(ist, d->sch, ds->sch_idx_dec,
&ist->decoder_opts, &ds->dec_opts);
if (ret < 0)