[FFmpeg-cvslog] Add av_copy_packet()

Andrey Utkin git at videolan.org
Fri Sep 21 01:07:39 CEST 2012


ffmpeg | branch: master | Andrey Utkin <andrey.krieger.utkin at gmail.com> | Thu Sep 20 17:30:03 2012 +0300| [cc07a7925e9967f8f9dcc47014d108ffa2f4cf51] | committer: Michael Niedermayer

Add av_copy_packet()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cc07a7925e9967f8f9dcc47014d108ffa2f4cf51
---

 libavcodec/avcodec.h  |    7 +++++++
 libavcodec/avpacket.c |    6 ++++++
 libavcodec/version.h  |    2 +-
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index fdfd5c4..e4bba5b 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3669,6 +3669,13 @@ int av_grow_packet(AVPacket *pkt, int grow_by);
 int av_dup_packet(AVPacket *pkt);
 
 /**
+ * Copy packet, including contents
+ *
+ * @return 0 on success, negative AVERROR on fail
+ */
+int av_copy_packet(AVPacket *dst, AVPacket *src);
+
+/**
  * Free a packet.
  *
  * @param pkt packet to free
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 8989190..516f1c9 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -165,6 +165,12 @@ int av_dup_packet(AVPacket *pkt)
     return 0;
 }
 
+int av_copy_packet(AVPacket *dst, AVPacket *src)
+{
+    *dst = *src;
+    return copy_packet_data(dst, src);
+}
+
 void av_free_packet(AVPacket *pkt)
 {
     if (pkt) {
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 3349789..7a779e6 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -27,7 +27,7 @@
  */
 
 #define LIBAVCODEC_VERSION_MAJOR 54
-#define LIBAVCODEC_VERSION_MINOR 56
+#define LIBAVCODEC_VERSION_MINOR 57
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \



More information about the ffmpeg-cvslog mailing list