aboutsummaryrefslogtreecommitdiffstats
path: root/fftools/ffmpeg_demux.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2024-01-17 10:53:19 +0100
committerAnton Khirnov <anton@khirnov.net>2024-01-30 09:52:00 +0100
commita938f47916f1035a9d89e3b0ce9fbf04915956d9 (patch)
tree280e4d4b3f412e47539e1a09d6efa1c0dbbcd7ef /fftools/ffmpeg_demux.c
parent474ca6c71e84b283fe72760ef368d5d730888dab (diff)
downloadffmpeg-a938f47916f1035a9d89e3b0ce9fbf04915956d9.tar.gz
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
Diffstat (limited to 'fftools/ffmpeg_demux.c')
-rw-r--r--fftools/ffmpeg_demux.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index 02add669a0..d804358d55 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -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);