diff mbox

[FFmpeg-devel,v1,2/2] avdevice/lavf: change the dumpgraph option to bool type

Message ID 20191120145456.20251-2-lance.lmwang@gmail.com
State New
Headers show

Commit Message

Limin Wang Nov. 20, 2019, 2:54 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

dumpgraph option currently uses string types, but actually only requires bool type

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 doc/indevs.texi     | 2 +-
 libavdevice/lavfi.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/doc/indevs.texi b/doc/indevs.texi
index 92bc65be41..19de11c516 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -979,7 +979,7 @@  filters. Syntax of the filtergraph is the same as the one specified by
 the option @var{graph}.
 
 @item dumpgraph
-Dump graph to stderr.
+Dump graph to stderr. Boolean value, by default disabled.
 
 @end table
 
diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index ca8f05f3f7..0804a62b90 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -47,7 +47,7 @@  typedef struct {
     AVClass *class;          ///< class for private options
     char          *graph_str;
     char          *graph_filename;
-    char          *dump_graph;
+    int dump_graph;
     AVFilterGraph *graph;
     AVFilterContext **sinks;
     int *sink_stream_map;
@@ -301,7 +301,7 @@  av_cold static int lavfi_read_header(AVFormatContext *avctx)
         goto end;
 
     if (lavfi->dump_graph) {
-        char *dump = avfilter_graph_dump(lavfi->graph, lavfi->dump_graph);
+        char *dump = avfilter_graph_dump(lavfi->graph, NULL);
         fputs(dump, stderr);
         fflush(stderr);
         av_free(dump);
@@ -489,7 +489,7 @@  static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt)
 static const AVOption options[] = {
     { "graph",     "set libavfilter graph", OFFSET(graph_str),  AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
     { "graph_file","set libavfilter graph filename", OFFSET(graph_filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC},
-    { "dumpgraph", "dump graph to stderr",  OFFSET(dump_graph), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
+    { "dumpgraph", "dump graph to stderr",  OFFSET(dump_graph), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DEC },
     { NULL },
 };