From: "Simon A. Eugster" <[email protected]>

Add a note that pkt->data and pkt->size must be initialized.
---
 libavcodec/avcodec.h |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 94c2ed7..63f2fc8 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3284,6 +3284,17 @@ void av_destruct_packet(AVPacket *pkt);
 /**
  * Initialize optional fields of a packet with default values.
  *
+ * Note, this does not touch the data and size members, which have to be
+ * initialized separately.
+ * \code{.cpp}
+    // [...]
+    AVPacket pkt;
+    av_init_packet(&pkt);
+    pkt.data = NULL;
+    pkt.size = 0;
+    avcodec_encode_video2(codec, &pkt, picture, &ok);
+ * \endcode
+ *
  * @param pkt packet
  */
 void av_init_packet(AVPacket *pkt);
-- 
1.7.9.4

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to