summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-03-24 14:51:44 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-03-24 14:51:44 +0100
commit3e1f24131ac018c8b4bcc852a02ccfadf20d1dbb (patch)
tree4fa15874bb03d2c88291ff5b9836cc1d189c2981 /libavutil
parent82e6660ae2372cdf96acb3bfebdd82b82f51d23f (diff)
parentd161ae0a37900cbd36c1390ca32a56b892c02ab5 (diff)
Merge commit 'd161ae0a37900cbd36c1390ca32a56b892c02ab5'
* commit 'd161ae0a37900cbd36c1390ca32a56b892c02ab5': frame: add a function for removing side data from a frame Conflicts: libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/frame.c16
-rw-r--r--libavutil/frame.h6
-rw-r--r--libavutil/version.h2
3 files changed, 23 insertions, 1 deletions
diff --git a/libavutil/frame.c b/libavutil/frame.c
index 747aa79b8f..07cdc213f2 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -642,3 +642,19 @@ int av_frame_copy(AVFrame *dst, const AVFrame *src)
return AVERROR(EINVAL);
}
+
+void av_frame_remove_side_data(AVFrame *frame, enum AVFrameSideDataType type)
+{
+ int i;
+
+ for (i = 0; i < frame->nb_side_data; i++) {
+ AVFrameSideData *sd = frame->side_data[i];
+ if (sd->type == type) {
+ av_freep(&sd->data);
+ av_dict_free(&sd->metadata);
+ av_freep(&frame->side_data[i]);
+ frame->side_data[i] = frame->side_data[frame->nb_side_data - 1];
+ frame->nb_side_data--;
+ }
+ }
+}
diff --git a/libavutil/frame.h b/libavutil/frame.h
index 6587439ab1..e68a96a39d 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -731,6 +731,12 @@ AVFrameSideData *av_frame_get_side_data(const AVFrame *frame,
enum AVFrameSideDataType type);
/**
+ * If side data of the supplied type exists in the frame, free it and remove it
+ * from the frame.
+ */
+void av_frame_remove_side_data(AVFrame *frame, enum AVFrameSideDataType type);
+
+/**
* @}
*/
diff --git a/libavutil/version.h b/libavutil/version.h
index d880dfdaf5..45f5adc804 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -56,7 +56,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 52
-#define LIBAVUTIL_VERSION_MINOR 68
+#define LIBAVUTIL_VERSION_MINOR 69
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \