aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Utkin <andrey.krieger.utkin@gmail.com>2012-09-20 17:30:03 +0300
committerMichael Niedermayer <michaelni@gmx.at>2012-09-21 01:03:31 +0200
commitcc07a7925e9967f8f9dcc47014d108ffa2f4cf51 (patch)
treeea8c106d99f545ab62ebe18b91693bfaf1bd226b
parentd33908a5fc8249b51fd5fbe0dfba46850e6536d0 (diff)
downloadffmpeg-cc07a7925e9967f8f9dcc47014d108ffa2f4cf51.tar.gz
Add av_copy_packet()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/avcodec.h7
-rw-r--r--libavcodec/avpacket.c6
-rw-r--r--libavcodec/version.h2
3 files changed, 14 insertions, 1 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index fdfd5c4c7c..e4bba5b090 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 8989190579..516f1c972b 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 3349789af3..7a779e6bce 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, \