diff mbox

[FFmpeg-devel,v1,1/3] avcodec/avpacket: replace the deprecated av_copy_packet_side_data

Message ID 20190904152712.23850-1-lance.lmwang@gmail.com
State New
Headers show

Commit Message

Lance Wang Sept. 4, 2019, 3:27 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavcodec/avpacket.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

James Almer Sept. 4, 2019, 3:31 p.m. UTC | #1
On 9/4/2019 12:27 PM, lance.lmwang@gmail.com wrote:
> From: Limin Wang <lance.lmwang@gmail.com>
> 
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
>  libavcodec/avpacket.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
> index 2b20067..34676cb 100644
> --- a/libavcodec/avpacket.c
> +++ b/libavcodec/avpacket.c
> @@ -198,8 +198,6 @@ do {                                         \
>  static int copy_packet_data(AVPacket *pkt, const AVPacket *src, int dup)
>  {
>      pkt->data      = NULL;
> -    pkt->side_data = NULL;
> -    pkt->side_data_elems = 0;
>      if (pkt->buf) {
>          AVBufferRef *ref = av_buffer_ref(src->buf);
>          if (!ref)
> @@ -214,7 +212,7 @@ static int copy_packet_data(AVPacket *pkt, const AVPacket *src, int dup)
>          pkt->side_data_elems = src->side_data_elems;
>      }
>      if (src->side_data_elems && !dup) {
> -        return av_copy_packet_side_data(pkt, src);
> +        return av_packet_copy_props(pkt, src);
>      }
>      return 0;

This is used entirely by deprecated functions, so there's no reason for
this change at all. This all will be gone as soon as we bump major version.
diff mbox

Patch

diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 2b20067..34676cb 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -198,8 +198,6 @@  do {                                         \
 static int copy_packet_data(AVPacket *pkt, const AVPacket *src, int dup)
 {
     pkt->data      = NULL;
-    pkt->side_data = NULL;
-    pkt->side_data_elems = 0;
     if (pkt->buf) {
         AVBufferRef *ref = av_buffer_ref(src->buf);
         if (!ref)
@@ -214,7 +212,7 @@  static int copy_packet_data(AVPacket *pkt, const AVPacket *src, int dup)
         pkt->side_data_elems = src->side_data_elems;
     }
     if (src->side_data_elems && !dup) {
-        return av_copy_packet_side_data(pkt, src);
+        return av_packet_copy_props(pkt, src);
     }
     return 0;