[FFmpeg-cvslog] avcodec: Remove ff_packet_free_side_data, use av_packet_free_side_data

Michael Niedermayer git at videolan.org
Mon Aug 12 03:07:07 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Aug 12 00:13:21 2013 +0200| [98fd8a78487f03998cb9d552ae2b7d7aee3ce4f1] | committer: Michael Niedermayer

avcodec: Remove ff_packet_free_side_data, use av_packet_free_side_data

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=98fd8a78487f03998cb9d552ae2b7d7aee3ce4f1
---

 libavcodec/avpacket.c |    9 ---------
 libavcodec/internal.h |    5 -----
 libavcodec/utils.c    |    8 ++++----
 3 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 8b65e45..7196c31 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -29,15 +29,6 @@
 #include "bytestream.h"
 #include "internal.h"
 
-void ff_packet_free_side_data(AVPacket *pkt)
-{
-    int i;
-    for (i = 0; i < pkt->side_data_elems; i++)
-        av_free(pkt->side_data[i].data);
-    av_freep(&pkt->side_data);
-    pkt->side_data_elems = 0;
-}
-
 #if FF_API_DESTRUCT_PACKET
 
 void av_destruct_packet(AVPacket *pkt)
diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index 477cdaf..8959243 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -140,11 +140,6 @@ int ff_init_buffer_info(AVCodecContext *s, AVFrame *frame);
 
 void avpriv_color_frame(AVFrame *frame, const int color[4]);
 
-/**
- * Remove and free all side data from packet.
- */
-void ff_packet_free_side_data(AVPacket *pkt);
-
 extern volatile int ff_avcodec_locked;
 int ff_lock_avcodec(AVCodecContext *log_ctx);
 int ff_unlock_avcodec(void);
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index c23805a..f845349 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1712,7 +1712,7 @@ int attribute_align_arg avcodec_encode_audio(AVCodecContext *avctx,
         avctx->coded_frame->key_frame = !!(pkt.flags & AV_PKT_FLAG_KEY);
     }
     /* free any side data since we cannot return it */
-    ff_packet_free_side_data(&pkt);
+    av_packet_free_side_data(&pkt);
 
     if (frame && frame->extended_data != frame->data)
         av_freep(&frame->extended_data);
@@ -2001,7 +2001,7 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
 
         avctx->pkt = NULL;
         if (did_split) {
-            ff_packet_free_side_data(&tmp);
+            av_packet_free_side_data(&tmp);
             if(ret == tmp.size)
                 ret = avpkt->size;
         }
@@ -2177,7 +2177,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
 
         avctx->pkt = NULL;
         if (did_split) {
-            ff_packet_free_side_data(&tmp);
+            av_packet_free_side_data(&tmp);
             if(ret == tmp.size)
                 ret = avpkt->size;
         }
@@ -2352,7 +2352,7 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
         }
 
         if (did_split) {
-            ff_packet_free_side_data(&tmp);
+            av_packet_free_side_data(&tmp);
             if(ret == tmp.size)
                 ret = avpkt->size;
         }



More information about the ffmpeg-cvslog mailing list