summaryrefslogtreecommitdiff
path: root/libavcodec/avcodec.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-02-24 13:14:02 +0100
committerAnton Khirnov <anton@khirnov.net>2012-03-03 06:31:41 +0100
commit7fb6c9225c309c55b85f6974627e26976817bff5 (patch)
tree1a4afa03fc8bd6e07674b54e860645147a1e3084 /libavcodec/avcodec.h
parente42e9b0e4d3eb8b2c9b5e1791344f211b590040c (diff)
lavc: free the output packet when encoding failed or produced no output.
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r--libavcodec/avcodec.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 19f114f78d..3598aaaa85 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3788,6 +3788,10 @@ int attribute_deprecated avcodec_encode_audio(AVCodecContext *avctx,
* avpkt->data is NULL, the encoder will allocate it.
* The encoder will set avpkt->size to the size of the
* output packet.
+ *
+ * If this function fails or produces no output, avpkt will be
+ * freed using av_free_packet() (i.e. avpkt->destruct will be
+ * called to free the user supplied buffer).
* @param[in] frame AVFrame containing the raw audio data to be encoded.
* May be NULL when flushing an encoder that has the
* CODEC_CAP_DELAY capability set.
@@ -3870,6 +3874,10 @@ int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
* The encoder will set avpkt->size to the size of the
* output packet. The returned data (if any) belongs to the
* caller, he is responsible for freeing it.
+ *
+ * If this function fails or produces no output, avpkt will be
+ * freed using av_free_packet() (i.e. avpkt->destruct will be
+ * called to free the user supplied buffer).
* @param[in] frame AVFrame containing the raw video data to be encoded.
* May be NULL when flushing an encoder that has the
* CODEC_CAP_DELAY capability set.