diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-10-29 16:16:44 +0300 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-10-29 16:16:44 +0300 |
commit | 87a6f532b46fb16eea07943325f5d322d08e13ed (patch) | |
tree | 26b4b24c5f3839c4aa7e66979870eb9ed98ddd00 /libavcodec | |
parent | 54de179caa39e1c2f3cbea61dd05f818bb78a3b6 (diff) | |
parent | 9b56d5c11488656254e9aed8d964ef2b7c2ff5e6 (diff) |
Merge commit '9b56d5c11488656254e9aed8d964ef2b7c2ff5e6'
* commit '9b56d5c11488656254e9aed8d964ef2b7c2ff5e6':
avpacket: Deprecate av_dup_packet
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/avcodec.h | 5 | ||||
-rw-r--r-- | libavcodec/avpacket.c | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index c4104cfa6c..936d9fe240 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3898,12 +3898,15 @@ int av_grow_packet(AVPacket *pkt, int grow_by); */ int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size); +#if FF_API_AVPACKET_OLD_API /** * @warning This is a hack - the packet memory allocation stuff is broken. The * packet is allocated if it was not really allocated. + * + * @deprecated Use av_packet_ref */ +attribute_deprecated int av_dup_packet(AVPacket *pkt); -#if FF_API_AVPACKET_OLD_API /** * Copy packet, including contents * diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index a87150ed82..34ef2659ef 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -130,6 +130,8 @@ int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size) return 0; } +#if FF_API_AVPACKET_OLD_API +FF_DISABLE_DEPRECATION_WARNINGS #define ALLOC_MALLOC(data, size) data = av_malloc(size) #define ALLOC_BUF(data, size) \ do { \ @@ -207,6 +209,8 @@ failed_alloc: av_packet_unref(pkt); return AVERROR(ENOMEM); } +FF_ENABLE_DEPRECATION_WARNINGS +#endif int av_dup_packet(AVPacket *pkt) { |