diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-09-21 09:07:02 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-09-24 12:31:24 +0200 |
commit | a42aadabc64f50124eece6e37e63eafa46e1a6ce (patch) | |
tree | 7648076429da19b5786b59821ddbd9fb30f504cc /libavcodec/avcodec.h | |
parent | b437cec143924eb2a7bbcbb7a7ec320d75d2edac (diff) | |
download | ffmpeg-a42aadabc64f50124eece6e37e63eafa46e1a6ce.tar.gz |
lavc: add avcodec_free_frame().
Since an AVFrame now has malloced members (extended_data), it must have
a destructor.
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r-- | libavcodec/avcodec.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 2bb308f1d1..a89805e558 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3257,7 +3257,7 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src); /** * Allocate an AVFrame and set its fields to default values. The resulting - * struct can be deallocated by simply calling av_free(). + * struct must be freed using avcodec_free_frame(). * * @return An AVFrame filled with default values or NULL on failure. * @see avcodec_get_frame_defaults @@ -3272,6 +3272,18 @@ AVFrame *avcodec_alloc_frame(void); void avcodec_get_frame_defaults(AVFrame *frame); /** + * Free the frame and any dynamically allocated objects in it, + * e.g. extended_data. + * + * @param frame frame to be freed. The pointer will be set to NULL. + * + * @warning this function does NOT free the data buffers themselves + * (it does not know how, since they might have been allocated with + * a custom get_buffer()). + */ +void avcodec_free_frame(AVFrame **frame); + +/** * Initialize the AVCodecContext to use the given AVCodec. Prior to using this * function the context has to be allocated with avcodec_alloc_context3(). * |