diff options
author | Anton Khirnov <anton@khirnov.net> | 2014-02-19 20:11:21 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2014-03-24 06:07:51 +0100 |
commit | d161ae0a37900cbd36c1390ca32a56b892c02ab5 (patch) | |
tree | 98e95976af28331c04fda86f3a76102b62148820 /libavutil/frame.c | |
parent | 59444c76e6d43529a12dbd80b6dd29c6ba4079a9 (diff) | |
download | ffmpeg-d161ae0a37900cbd36c1390ca32a56b892c02ab5.tar.gz |
frame: add a function for removing side data from a frame
Diffstat (limited to 'libavutil/frame.c')
-rw-r--r-- | libavutil/frame.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libavutil/frame.c b/libavutil/frame.c index f81bbbd138..cc4bfcdf4b 100644 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@ -526,3 +526,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--; + } + } +} |