@ -30,22 +30,6 @@
# include "bytestream.h"
# include "internal.h"
# if FF_API_DESTRUCT_PACKET
void av_destruct_packet ( AVPacket * pkt )
{
av_freep ( & pkt - > data ) ;
pkt - > size = 0 ;
}
/* a dummy destruct callback for the callers that assume AVPacket.destruct ==
* NULL = > static data */
static void dummy_destruct_packet ( AVPacket * pkt )
{
av_assert0 ( 0 ) ;
}
# endif
void av_init_packet ( AVPacket * pkt )
{
pkt - > pts = AV_NOPTS_VALUE ;
@ -55,11 +39,6 @@ void av_init_packet(AVPacket *pkt)
pkt - > convergence_duration = 0 ;
pkt - > flags = 0 ;
pkt - > stream_index = 0 ;
# if FF_API_DESTRUCT_PACKET
FF_DISABLE_DEPRECATION_WARNINGS
pkt - > destruct = NULL ;
FF_ENABLE_DEPRECATION_WARNINGS
# endif
pkt - > buf = NULL ;
pkt - > side_data = NULL ;
pkt - > side_data_elems = 0 ;
@ -91,11 +70,6 @@ int av_new_packet(AVPacket *pkt, int size)
pkt - > buf = buf ;
pkt - > data = buf - > data ;
pkt - > size = size ;
# if FF_API_DESTRUCT_PACKET
FF_DISABLE_DEPRECATION_WARNINGS
pkt - > destruct = dummy_destruct_packet ;
FF_ENABLE_DEPRECATION_WARNINGS
# endif
return 0 ;
}
@ -128,11 +102,6 @@ int av_grow_packet(AVPacket *pkt, int grow_by)
if ( ! pkt - > buf )
return AVERROR ( ENOMEM ) ;
memcpy ( pkt - > buf - > data , pkt - > data , FFMIN ( pkt - > size , pkt - > size + grow_by ) ) ;
# if FF_API_DESTRUCT_PACKET
FF_DISABLE_DEPRECATION_WARNINGS
pkt - > destruct = dummy_destruct_packet ;
FF_ENABLE_DEPRECATION_WARNINGS
# endif
}
pkt - > data = pkt - > buf - > data ;
pkt - > size + = grow_by ;
@ -153,11 +122,6 @@ int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size)
pkt - > data = data ;
pkt - > size = size ;
# if FF_API_DESTRUCT_PACKET
FF_DISABLE_DEPRECATION_WARNINGS
pkt - > destruct = dummy_destruct_packet ;
FF_ENABLE_DEPRECATION_WARNINGS
# endif
return 0 ;
}
@ -203,11 +167,6 @@ static int copy_packet_data(AVPacket *pkt, const AVPacket *src, int dup)
} else {
DUP_DATA ( pkt - > data , src - > data , pkt - > size , 1 , ALLOC_BUF ) ;
}
# if FF_API_DESTRUCT_PACKET
FF_DISABLE_DEPRECATION_WARNINGS
pkt - > destruct = dummy_destruct_packet ;
FF_ENABLE_DEPRECATION_WARNINGS
# endif
if ( pkt - > side_data_elems & & dup )
pkt - > side_data = src - > side_data ;
if ( pkt - > side_data_elems & & ! dup ) {
@ -280,15 +239,8 @@ void av_packet_free_side_data(AVPacket *pkt)
void av_free_packet ( AVPacket * pkt )
{
if ( pkt ) {
FF_DISABLE_DEPRECATION_WARNINGS
if ( pkt - > buf )
av_buffer_unref ( & pkt - > buf ) ;
# if FF_API_DESTRUCT_PACKET
else if ( pkt - > destruct )
pkt - > destruct ( pkt ) ;
pkt - > destruct = NULL ;
# endif
FF_ENABLE_DEPRECATION_WARNINGS
pkt - > data = NULL ;
pkt - > size = 0 ;