[FFmpeg-devel] [PATCH 2/2] lavfi: flag dynamically allocated pads
Paul B Mahol
onemda at gmail.com
Thu Jul 11 00:00:48 CEST 2013
Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
libavfilter/avfilter.c | 1 +
libavfilter/avfilter.h | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index b05f4e8..92d2a73 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -107,6 +107,7 @@ int ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
return AVERROR(ENOMEM);
memmove(*pads + idx + 1, *pads + idx, sizeof(AVFilterPad) * (*count - idx));
memmove(*links + idx + 1, *links + idx, sizeof(AVFilterLink*) * (*count - idx));
+ newpad->allocated = 1;
memcpy(*pads + idx, newpad, sizeof(AVFilterPad));
(*links)[idx] = NULL;
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index 0001cd7..8cfabf5 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -385,6 +385,11 @@ struct AVFilterPad {
int needs_fifo;
int needs_writable;
+
+ /**
+ * If 1 this pad is dynamically allocated.
+ */
+ int allocated;
};
#endif
--
1.7.11.2
More information about the ffmpeg-devel
mailing list