diff mbox

[FFmpeg-devel,1/3] avcodec/avpacket: deprecate av_copy_packet()

Message ID 20170923233503.364-1-jamrial@gmail.com
State Accepted
Commit ecb9741ba294d7617ca85aaec0226ee9be7f518d
Headers show

Commit Message

James Almer Sept. 23, 2017, 11:35 p.m. UTC
It does the same thing as av_packet_ref().

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/avcodec.h  | 3 +++
 libavcodec/avpacket.c | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

Comments

James Almer Sept. 25, 2017, 6:08 p.m. UTC | #1
On 9/23/2017 8:35 PM, James Almer wrote:
> It does the same thing as av_packet_ref().
> 
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavcodec/avcodec.h  | 3 +++
>  libavcodec/avpacket.c | 4 ++--
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index bca9f30de3..693e988c09 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -4614,7 +4614,10 @@ int av_dup_packet(AVPacket *pkt);
>   * Copy packet, including contents
>   *
>   * @return 0 on success, negative AVERROR on fail
> + *
> + * @deprecated Use av_packet_ref
>   */
> +attribute_deprecated
>  int av_copy_packet(AVPacket *dst, const AVPacket *src);
>  
>  /**
> diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
> index 5ce3228166..b07180eac8 100644
> --- a/libavcodec/avpacket.c
> +++ b/libavcodec/avpacket.c
> @@ -247,8 +247,6 @@ failed_alloc:
>      av_packet_unref(pkt);
>      return AVERROR(ENOMEM);
>  }
> -FF_ENABLE_DEPRECATION_WARNINGS
> -#endif
>  
>  int av_dup_packet(AVPacket *pkt)
>  {
> @@ -266,6 +264,8 @@ int av_copy_packet(AVPacket *dst, const AVPacket *src)
>      *dst = *src;
>      return copy_packet_data(dst, src, 0);
>  }
> +FF_ENABLE_DEPRECATION_WARNINGS
> +#endif
>  
>  void av_packet_free_side_data(AVPacket *pkt)
>  {
> 

Will push this set later today or tomorrow if nobody objects.
James Almer Sept. 26, 2017, 12:30 a.m. UTC | #2
On 9/25/2017 3:08 PM, James Almer wrote:
> On 9/23/2017 8:35 PM, James Almer wrote:
>> It does the same thing as av_packet_ref().
>>
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>>  libavcodec/avcodec.h  | 3 +++
>>  libavcodec/avpacket.c | 4 ++--
>>  2 files changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
>> index bca9f30de3..693e988c09 100644
>> --- a/libavcodec/avcodec.h
>> +++ b/libavcodec/avcodec.h
>> @@ -4614,7 +4614,10 @@ int av_dup_packet(AVPacket *pkt);
>>   * Copy packet, including contents
>>   *
>>   * @return 0 on success, negative AVERROR on fail
>> + *
>> + * @deprecated Use av_packet_ref
>>   */
>> +attribute_deprecated
>>  int av_copy_packet(AVPacket *dst, const AVPacket *src);
>>  
>>  /**
>> diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
>> index 5ce3228166..b07180eac8 100644
>> --- a/libavcodec/avpacket.c
>> +++ b/libavcodec/avpacket.c
>> @@ -247,8 +247,6 @@ failed_alloc:
>>      av_packet_unref(pkt);
>>      return AVERROR(ENOMEM);
>>  }
>> -FF_ENABLE_DEPRECATION_WARNINGS
>> -#endif
>>  
>>  int av_dup_packet(AVPacket *pkt)
>>  {
>> @@ -266,6 +264,8 @@ int av_copy_packet(AVPacket *dst, const AVPacket *src)
>>      *dst = *src;
>>      return copy_packet_data(dst, src, 0);
>>  }
>> +FF_ENABLE_DEPRECATION_WARNINGS
>> +#endif
>>  
>>  void av_packet_free_side_data(AVPacket *pkt)
>>  {
>>
> 
> Will push this set later today or tomorrow if nobody objects.

Patchset pushed.
diff mbox

Patch

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index bca9f30de3..693e988c09 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -4614,7 +4614,10 @@  int av_dup_packet(AVPacket *pkt);
  * Copy packet, including contents
  *
  * @return 0 on success, negative AVERROR on fail
+ *
+ * @deprecated Use av_packet_ref
  */
+attribute_deprecated
 int av_copy_packet(AVPacket *dst, const AVPacket *src);
 
 /**
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 5ce3228166..b07180eac8 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -247,8 +247,6 @@  failed_alloc:
     av_packet_unref(pkt);
     return AVERROR(ENOMEM);
 }
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 
 int av_dup_packet(AVPacket *pkt)
 {
@@ -266,6 +264,8 @@  int av_copy_packet(AVPacket *dst, const AVPacket *src)
     *dst = *src;
     return copy_packet_data(dst, src, 0);
 }
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
 void av_packet_free_side_data(AVPacket *pkt)
 {