mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-26 01:02:33 +00:00
fftools/ffmpeg: refactor disabling decoder threading for attached pictures
* as this decision is based on demuxing information, move it from the decoder to the demuxer * as the issue being addressed is latency added by frame threading, we only need to disable frame threading, not all threading
This commit is contained in:
parent
474ca6c71e
commit
a938f47916
@ -960,9 +960,6 @@ int dec_open(InputStream *ist, Scheduler *sch, unsigned sch_idx,
|
||||
|
||||
if (!av_dict_get(*dec_opts, "threads", NULL, 0))
|
||||
av_dict_set(dec_opts, "threads", "auto", 0);
|
||||
/* Attached pics are sparse, therefore we would not want to delay their decoding till EOF. */
|
||||
if (ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC)
|
||||
av_dict_set(dec_opts, "threads", "1", 0);
|
||||
|
||||
av_dict_set(dec_opts, "flags", "+copy_opaque", AV_DICT_MULTIKEY);
|
||||
|
||||
|
@ -1259,6 +1259,11 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st)
|
||||
if (o->bitexact)
|
||||
av_dict_set(&ist->decoder_opts, "flags", "+bitexact", AV_DICT_MULTIKEY);
|
||||
|
||||
/* Attached pics are sparse, therefore we would not want to delay their decoding
|
||||
* till EOF. */
|
||||
if (ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC)
|
||||
av_dict_set(&ist->decoder_opts, "thread_type", "-frame", 0);
|
||||
|
||||
switch (par->codec_type) {
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
MATCH_PER_STREAM_OPT(frame_rates, str, framerate, ic, st);
|
||||
|
Loading…
Reference in New Issue
Block a user