From 5bb3f8825584a319b25b430e4ece2fa5b2b47ff9 Mon Sep 17 00:00:00 2001 From: Roman Fietze Date: Thu, 3 Apr 2014 12:45:35 +0200 Subject: [PATCH] avcodec.h, avpacket.c: use const AVPacket pointers in copy functions Signed-off-by: Roman Fietze Signed-off-by: Michael Niedermayer --- libavcodec/avcodec.h | 6 +++--- libavcodec/avpacket.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index e9163a73d0..09295e0691 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3602,14 +3602,14 @@ int av_dup_packet(AVPacket *pkt); * * @return 0 on success, negative AVERROR on fail */ -int av_copy_packet(AVPacket *dst, AVPacket *src); +int av_copy_packet(AVPacket *dst, const AVPacket *src); /** * Copy packet side data * * @return 0 on success, negative AVERROR on fail */ -int av_copy_packet_side_data(AVPacket *dst, AVPacket *src); +int av_copy_packet_side_data(AVPacket *dst, const AVPacket *src); /** * Free a packet. @@ -3698,7 +3698,7 @@ void av_packet_free_side_data(AVPacket *pkt); * * @return 0 on success, a negative AVERROR on error. */ -int av_packet_ref(AVPacket *dst, AVPacket *src); +int av_packet_ref(AVPacket *dst, const AVPacket *src); /** * Wipe the packet. diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index f966bfe894..00f741af59 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -190,7 +190,7 @@ do { \ } while (0) /* Makes duplicates of data, side_data, but does not copy any other fields */ -static int copy_packet_data(AVPacket *pkt, AVPacket *src, int dup) +static int copy_packet_data(AVPacket *pkt, const AVPacket *src, int dup) { pkt->data = NULL; pkt->side_data = NULL; @@ -220,7 +220,7 @@ failed_alloc: return AVERROR(ENOMEM); } -int av_copy_packet_side_data(AVPacket *pkt, AVPacket *src) +int av_copy_packet_side_data(AVPacket *pkt, const AVPacket *src) { if (src->side_data_elems) { int i; @@ -262,7 +262,7 @@ FF_ENABLE_DEPRECATION_WARNINGS return 0; } -int av_copy_packet(AVPacket *dst, AVPacket *src) +int av_copy_packet(AVPacket *dst, const AVPacket *src) { *dst = *src; return copy_packet_data(dst, src, 0); @@ -534,7 +534,7 @@ void av_packet_unref(AVPacket *pkt) pkt->size = 0; } -int av_packet_ref(AVPacket *dst, AVPacket *src) +int av_packet_ref(AVPacket *dst, const AVPacket *src) { int ret;