Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-04-25 02:25:18 +0400
committerStefano Sabatini <stefasab@gmail.com>2012-04-27 23:38:13 +0400
commit6b55aab01a5c2e4c9f2851fdb9b7583f184b5241 (patch)
treef7003f2883ea88506de887a9304ba633f9160dcc /libavfilter/internal.h
parent6f3b1d7f8643932a4ffc582cc77d8c5fe81b904d (diff)
lavfi: create buffer reference in filters which need to access the ref later
Also add internal function ff_null_start_frame_keep_ref(). Fix crash when a following filter (e.g. settb) will unref the reference passed by start_frame(), and then the reference is accessed in end_frame() through inlink->cur_buf.
Diffstat (limited to 'libavfilter/internal.h')
-rw-r--r--libavfilter/internal.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index 47d735182d..e8516c3ba1 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -140,4 +140,13 @@ int ff_parse_channel_layout(int64_t *ret, const char *arg, void *log_ctx);
*/
int ff_parse_packing_format(int *ret, const char *arg, void *log_ctx);
+/**
+ * Pass video frame along and keep an internal reference for later use.
+ */
+static inline void ff_null_start_frame_keep_ref(AVFilterLink *inlink,
+ AVFilterBufferRef *picref)
+{
+ avfilter_start_frame(inlink->dst->outputs[0], avfilter_ref_buffer(picref, ~0));
+}
+
#endif /* AVFILTER_INTERNAL_H */