diff options
author | Anton Khirnov <[email protected]> | 2024-01-23 18:42:20 +0100 |
---|---|---|
committer | Anton Khirnov <[email protected]> | 2024-01-30 09:52:00 +0100 |
commit | b3d1916ba03086d9d1e80a2ff5fdee2c915152ae (patch) | |
tree | 8b994c1577a587216acc125c774b690a7bda6d34 | |
parent | d5f9ef766b4e7958f3cf75c6b838fbe0f22936c5 (diff) |
fftools/ffmpeg_dec: pass AVCodec through DecoderOpts
Do not retrieve it from InputStream directly.
This is a step towards decoupling Decoder and InputStream.
-rw-r--r-- | fftools/ffmpeg.h | 2 | ||||
-rw-r--r-- | fftools/ffmpeg_dec.c | 2 | ||||
-rw-r--r-- | fftools/ffmpeg_demux.c | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index bdfacf16b7..b169b1a323 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -297,6 +297,8 @@ typedef struct DecoderOpts { char *name; + const AVCodec *codec; + /* hwaccel options */ enum HWAccelID hwaccel_id; enum AVHWDeviceType hwaccel_device_type; diff --git a/fftools/ffmpeg_dec.c b/fftools/ffmpeg_dec.c index 734549ed0b..e41440b21d 100644 --- a/fftools/ffmpeg_dec.c +++ b/fftools/ffmpeg_dec.c @@ -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); diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index 8bc73e2bf3..f66319aafe 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -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) |