diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-04-25 00:25:18 +0200 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-04-27 21:38:13 +0200 |
commit | 6b55aab01a5c2e4c9f2851fdb9b7583f184b5241 (patch) | |
tree | f7003f2883ea88506de887a9304ba633f9160dcc /libavfilter/internal.h | |
parent | 6f3b1d7f8643932a4ffc582cc77d8c5fe81b904d (diff) | |
download | ffmpeg-6b55aab01a5c2e4c9f2851fdb9b7583f184b5241.tar.gz |
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.h | 9 |
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 */ |