summaryrefslogtreecommitdiff
path: root/fftools/ffmpeg_demux.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-04-11 13:05:46 +0200
committerAnton Khirnov <anton@khirnov.net>2023-04-17 12:01:40 +0200
commitff92ecad2fca6143637538fb7ab3423205ebb4a7 (patch)
tree046ae2022d3c1588e22d7ea1e85365eb32f62f1b /fftools/ffmpeg_demux.c
parentae071c9e3944ebe12e4088c81992f31d974ea904 (diff)
downloadffmpeg-ff92ecad2fca6143637538fb7ab3423205ebb4a7.tar.gz
fftools/ffmpeg: stop setting InputStream fields from muxing/filtering code
Set InputStream.decoding_needed/discard/etc. only from ist_{filter,output},add() functions. Reduces the knowledge of InputStream internals in muxing/filtering code.
Diffstat (limited to 'fftools/ffmpeg_demux.c')
-rw-r--r--fftools/ffmpeg_demux.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index 6f68c7f6b5..c7141abadf 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -561,14 +561,25 @@ void ifile_close(InputFile **pf)
av_freep(pf);
}
+static void ist_use(InputStream *ist, int decoding_needed)
+{
+ ist->discard = 0;
+ ist->st->discard = ist->user_set_discard;
+ ist->decoding_needed |= decoding_needed;
+}
+
void ist_output_add(InputStream *ist, OutputStream *ost)
{
+ ist_use(ist, ost->enc ? DECODING_FOR_OST : 0);
+
GROW_ARRAY(ist->outputs, ist->nb_outputs);
ist->outputs[ist->nb_outputs - 1] = ost;
}
-void ist_filter_add(InputStream *ist, InputFilter *ifilter)
+void ist_filter_add(InputStream *ist, InputFilter *ifilter, int is_simple)
{
+ ist_use(ist, is_simple ? DECODING_FOR_OST : DECODING_FOR_FILTER);
+
GROW_ARRAY(ist->filters, ist->nb_filters);
ist->filters[ist->nb_filters - 1] = ifilter;
}