diff options
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r-- | libavcodec/avcodec.h | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 0d643478f6..f6522d1d1a 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3509,7 +3509,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 @@ -3519,9 +3519,21 @@ AVFrame *avcodec_alloc_frame(void); /** * Set the fields of the given AVFrame to default values. * - * @param pic The AVFrame of which the fields should be set to default values. + * @param frame The AVFrame of which the fields should be set to default values. */ -void avcodec_get_frame_defaults(AVFrame *pic); +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); #if FF_API_AVCODEC_OPEN /** |