From 91d2efa7d6b4309af4be0f4e27f9cc8d9d874390 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 31 Mar 2013 08:20:06 +0200 Subject: [PATCH 1/2] lavfi: add const to AVFilterContext.filter. lavfi should never modify the filter through that pointer. --- libavfilter/avfilter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index f0b79f5957..f598b9fde5 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -439,7 +439,7 @@ typedef struct AVFilter { struct AVFilterContext { const AVClass *av_class; ///< needed for av_log() - AVFilter *filter; ///< the AVFilter of which this is an instance + const AVFilter *filter; ///< the AVFilter of which this is an instance char *name; ///< name of this filter instance From 4a37d4b3f8137a4c2bbbca043de076af966b9446 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 28 Mar 2013 09:31:42 +0100 Subject: [PATCH 2/2] lavfi: add const to the pads parameter of avfilter_pad_get_name/type --- libavfilter/avfilter.c | 4 ++-- libavfilter/avfilter.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index ccf4950c96..7c5a971fe2 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -627,12 +627,12 @@ fail: return ret; } -const char *avfilter_pad_get_name(AVFilterPad *pads, int pad_idx) +const char *avfilter_pad_get_name(const AVFilterPad *pads, int pad_idx) { return pads[pad_idx].name; } -enum AVMediaType avfilter_pad_get_type(AVFilterPad *pads, int pad_idx) +enum AVMediaType avfilter_pad_get_type(const AVFilterPad *pads, int pad_idx) { return pads[pad_idx].type; } diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index f598b9fde5..ac25bfe842 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -359,7 +359,7 @@ struct AVFilterPad { * * @return name of the pad_idx'th pad in pads */ -const char *avfilter_pad_get_name(AVFilterPad *pads, int pad_idx); +const char *avfilter_pad_get_name(const AVFilterPad *pads, int pad_idx); /** * Get the type of an AVFilterPad. @@ -370,7 +370,7 @@ const char *avfilter_pad_get_name(AVFilterPad *pads, int pad_idx); * * @return type of the pad_idx'th pad in pads */ -enum AVMediaType avfilter_pad_get_type(AVFilterPad *pads, int pad_idx); +enum AVMediaType avfilter_pad_get_type(const AVFilterPad *pads, int pad_idx); /** * Filter definition. This defines the pads a filter contains, and all the