diff mbox series

[FFmpeg-devel,03/24] fftools/ffmpeg_filter: use a dedicated variable for marking simple filtergraphs

Message ID 20230528091416.17927-3-anton@khirnov.net
State Accepted
Commit badf959ed6264ad4fce6e8e815e5dd9a5743c848
Headers show
Series [FFmpeg-devel,01/24] fftools/ffmpeg_mux_init: merge ost_add_from_filter() to ost_add() | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov May 28, 2023, 9:13 a.m. UTC
Do not use an unrelated graph property, which will change in future
commits.
---
 fftools/ffmpeg_filter.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index f37b867b31..e11ae2e9bf 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -41,6 +41,8 @@ 
 typedef struct FilterGraphPriv {
     FilterGraph fg;
 
+    int is_simple;
+
     const char *graph_desc;
 
     // frame for temporarily holding output from the filtergraph
@@ -353,6 +355,7 @@  FilterGraph *fg_create(char *graph_desc)
 int init_simple_filtergraph(InputStream *ist, OutputStream *ost)
 {
     FilterGraph *fg;
+    FilterGraphPriv *fgp;
     OutputFilter *ofilter;
     InputFilter  *ifilter;
     int ret;
@@ -360,6 +363,9 @@  int init_simple_filtergraph(InputStream *ist, OutputStream *ost)
     fg = fg_create(NULL);
     if (!fg)
         report_and_exit(AVERROR(ENOMEM));
+    fgp = fgp_from_fg(fg);
+
+    fgp->is_simple = 1;
 
     ofilter      = ofilter_alloc(fg);
     ofilter->ost = ost;
@@ -1474,7 +1480,7 @@  int ifilter_has_all_input_formats(FilterGraph *fg)
 int filtergraph_is_simple(FilterGraph *fg)
 {
     FilterGraphPriv *fgp = fgp_from_fg(fg);
-    return !fgp->graph_desc;
+    return fgp->is_simple;
 }
 
 int reap_filters(int flush)