avpacket: Replace av_free_packet with av_packet_unref
[ffmpeg.git] / libavcodec / avpacket.c
index e762a87..eaea061 100644 (file)
@@ -184,7 +184,7 @@ int av_dup_packet(AVPacket *pkt)
     return 0;
 
 failed_alloc:
-    av_free_packet(pkt);
+    av_packet_unref(pkt);
     return AVERROR(ENOMEM);
 }
 
@@ -197,6 +197,8 @@ void av_packet_free_side_data(AVPacket *pkt)
     pkt->side_data_elems = 0;
 }
 
+#if FF_API_AVPACKET_OLD_API
+FF_DISABLE_DEPRECATION_WARNINGS
 void av_free_packet(AVPacket *pkt)
 {
     if (pkt) {
@@ -208,6 +210,8 @@ void av_free_packet(AVPacket *pkt)
         av_packet_free_side_data(pkt);
     }
 }
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
 uint8_t *av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
                                  int size)