summaryrefslogtreecommitdiff
path: root/libavfilter/avfilter.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-06-01 14:46:54 +0200
committerStefano Sabatini <stefasab@gmail.com>2012-06-04 00:54:57 +0200
commit4d6a8a2bdb19c4380cc458759b7bd221942a028f (patch)
tree1488a8dd15ae00c556a1363e760370fcce8a597b /libavfilter/avfilter.c
parent7d82020fcb7f81fcbbd30b7546ba62af45f1a33c (diff)
lavfi: add avfilter_default_filter_name()
The function is modelled after av_default_item_name(), and will print the name of the instance filter if defined, otherwise the name of the filter. This allows to show the instance name in the log, which is useful when debugging complex filter graphs.
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r--libavfilter/avfilter.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 0c3e7edb11..b56106a857 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -366,15 +366,15 @@ static int pad_count(const AVFilterPad *pads)
return count;
}
-static const char *filter_name(void *p)
+const char *avfilter_default_filter_name(void *filter_ctx)
{
- AVFilterContext *filter = p;
- return filter->filter->name;
+ AVFilterContext *ctx = filter_ctx;
+ return ctx->name ? ctx->name : ctx->filter->name;
}
static const AVClass avfilter_class = {
.class_name = "AVFilter",
- .item_name = filter_name,
+ .item_name = avfilter_default_filter_name,
.version = LIBAVUTIL_VERSION_INT,
.category = AV_CLASS_CATEGORY_FILTER,
};