[FFmpeg-devel] [PATCH] lavfi/avfiltergraph: improve error message in graph_check_validity()

Clément Bœsch ubitux at gmail.com
Wed Nov 21 22:08:41 CET 2012


On Wed, Nov 21, 2012 at 10:01:00PM +0100, Stefano Sabatini wrote:
> Fix trac ticket #1944.
> ---
>  libavfilter/avfiltergraph.c |   11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
> index d75af90..cff0fa9 100644
> --- a/libavfilter/avfiltergraph.c
> +++ b/libavfilter/avfiltergraph.c
> @@ -113,22 +113,25 @@ static int graph_check_validity(AVFilterGraph *graph, AVClass *log_ctx)
>      int i, j;
>  
>      for (i = 0; i < graph->filter_count; i++) {
> +        const AVFilterPad *pad;
>          filt = graph->filters[i];
>  
>          for (j = 0; j < filt->nb_inputs; j++) {
>              if (!filt->inputs[j] || !filt->inputs[j]->src) {
> +                pad = &filt->input_pads[j];
>                  av_log(log_ctx, AV_LOG_ERROR,
> -                       "Input pad \"%s\" for the filter \"%s\" of type \"%s\" not connected to any source\n",
> -                       filt->input_pads[j].name, filt->name, filt->filter->name);
> +                       "Input pad \"%s\" with type %s of the filter instance \"%s\" of %s not connected to any source\n",
> +                       pad->name, av_get_media_type_string(pad->type), filt->name, filt->filter->name);
>                  return AVERROR(EINVAL);
>              }
>          }
>  
>          for (j = 0; j < filt->nb_outputs; j++) {
>              if (!filt->outputs[j] || !filt->outputs[j]->dst) {
> +                pad = &filt->output_pads[j];
>                  av_log(log_ctx, AV_LOG_ERROR,
> -                       "Output pad \"%s\" for the filter \"%s\" of type \"%s\" not connected to any destination\n",
> -                       filt->output_pads[j].name, filt->name, filt->filter->name);
> +                       "Output pad \"%s\" with type %s of the filter instance \"%s\" of %s not connected to any destination\n",
> +                       pad->name, av_get_media_type_string(pad->type), filt->name, filt->filter->name);
>                  return AVERROR(EINVAL);
>              }
>          }

Aren't you just adding the pad type?

I think the main issue was about pointing out what output wasn't linked,
and use the user's name for that output in the message. Do we have access
to it here?

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121121/6d512b2d/attachment.asc>


More information about the ffmpeg-devel mailing list