diff options
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 4362aeb548..a370e3ebb8 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3463,12 +3463,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 /** * Free a packet. * diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index eaea061c54..cec5bf89c3 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -128,6 +128,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 { \ @@ -187,6 +189,8 @@ failed_alloc: av_packet_unref(pkt); return AVERROR(ENOMEM); } +FF_ENABLE_DEPRECATION_WARNINGS +#endif void av_packet_free_side_data(AVPacket *pkt) { |