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:
@@ -297,6 +297,8 @@ typedef struct DecoderOpts {
|
|||||||
|
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
|
const AVCodec *codec;
|
||||||
|
|
||||||
/* hwaccel options */
|
/* hwaccel options */
|
||||||
enum HWAccelID hwaccel_id;
|
enum HWAccelID hwaccel_id;
|
||||||
enum AVHWDeviceType hwaccel_device_type;
|
enum AVHWDeviceType hwaccel_device_type;
|
||||||
|
@@ -951,7 +951,7 @@ int dec_open(InputStream *ist, Scheduler *sch, unsigned sch_idx,
|
|||||||
AVDictionary **dec_opts, const DecoderOpts *o)
|
AVDictionary **dec_opts, const DecoderOpts *o)
|
||||||
{
|
{
|
||||||
DecoderPriv *dp;
|
DecoderPriv *dp;
|
||||||
const AVCodec *codec = ist->dec;
|
const AVCodec *codec = o->codec;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = dec_alloc(&ist->decoder);
|
ret = dec_alloc(&ist->decoder);
|
||||||
|
@@ -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);
|
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.name = ds->dec_name;
|
||||||
|
|
||||||
|
ds->dec_opts.codec = ist->dec;
|
||||||
|
|
||||||
ret = dec_open(ist, d->sch, ds->sch_idx_dec,
|
ret = dec_open(ist, d->sch, ds->sch_idx_dec,
|
||||||
&ist->decoder_opts, &ds->dec_opts);
|
&ist->decoder_opts, &ds->dec_opts);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
Reference in New Issue
Block a user