diff mbox

[FFmpeg-devel] ffmpeg_filter: enhance reporting of unconnected pads.

Message ID 20191202181901.1124-1-george@nsup.org
State New
Headers show

Commit Message

Nicolas George Dec. 2, 2019, 6:19 p.m. UTC
Signed-off-by: Nicolas George <george@nsup.org>
---
 fftools/ffmpeg_filter.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Carl Eugen Hoyos Dec. 2, 2019, 6:25 p.m. UTC | #1
Am Mo., 2. Dez. 2019 um 19:19 Uhr schrieb Nicolas George <george@nsup.org>:
>
> Signed-off-by: Nicolas George <george@nsup.org>
> ---
>  fftools/ffmpeg_filter.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
> index 72838de1e2..ff46ffab01 100644
> --- a/fftools/ffmpeg_filter.c
> +++ b/fftools/ffmpeg_filter.c
> @@ -269,6 +269,13 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
>          char *p;
>          int file_idx = strtol(in->name, &p, 0);
>
> +        av_log(0, 16, "name = %s\n", in->name);
> +        if (p == in->name) {
> +            av_log(NULL, AV_LOG_FATAL,
> +                   "Unconnected pad [%s] is not a stream selector in filtergraph description %s.\n",
> +                   in->name, fg->graph_desc);

> +            exit_program(1);

Does this change behaviour apart from printing an error message?

Carl Eugen
Nicolas George Dec. 2, 2019, 6:30 p.m. UTC | #2
Carl Eugen Hoyos (12019-12-02):
> Does this change behaviour apart from printing an error message?

I thought it did not, but I re-checked to reply, and it does. Patch
withdrawn, for now.

Regards,
diff mbox

Patch

diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 72838de1e2..ff46ffab01 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -269,6 +269,13 @@  static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
         char *p;
         int file_idx = strtol(in->name, &p, 0);
 
+        av_log(0, 16, "name = %s\n", in->name);
+        if (p == in->name) {
+            av_log(NULL, AV_LOG_FATAL,
+                   "Unconnected pad [%s] is not a stream selector in filtergraph description %s.\n",
+                   in->name, fg->graph_desc);
+            exit_program(1);
+        }
         if (file_idx < 0 || file_idx >= nb_input_files) {
             av_log(NULL, AV_LOG_FATAL, "Invalid file index %d in filtergraph description %s.\n",
                    file_idx, fg->graph_desc);