Skip to content

Commit

Permalink
Remove left-over FF_API_DESTRUCT_PACKET cruft
Browse files Browse the repository at this point in the history
  • Loading branch information
Nevcairiel committed Sep 5, 2015
1 parent 87c8812 commit 83a5df5
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 56 deletions.
8 changes: 1 addition & 7 deletions ffmpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,13 +692,7 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
&new_pkt.data, &new_pkt.size,
pkt->data, pkt->size,
pkt->flags & AV_PKT_FLAG_KEY);
FF_DISABLE_DEPRECATION_WARNINGS
if(a == 0 && new_pkt.data != pkt->data
#if FF_API_DESTRUCT_PACKET
&& new_pkt.destruct
#endif
) {
FF_ENABLE_DEPRECATION_WARNINGS
if(a == 0 && new_pkt.data != pkt->data) {
uint8_t *t = av_malloc(new_pkt.size + AV_INPUT_BUFFER_PADDING_SIZE); //the new should be a subset of the old so cannot overflow
if(t) {
memcpy(t, new_pkt.data, new_pkt.size);
Expand Down
13 changes: 1 addition & 12 deletions libavcodec/avpacket.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,7 @@ int av_dup_packet(AVPacket *pkt)
{
AVPacket tmp_pkt;

FF_DISABLE_DEPRECATION_WARNINGS
if (!pkt->buf && pkt->data
#if FF_API_DESTRUCT_PACKET
&& !pkt->destruct
#endif
) {
FF_ENABLE_DEPRECATION_WARNINGS
if (!pkt->buf && pkt->data) {
tmp_pkt = *pkt;
return copy_packet_data(pkt, &tmp_pkt, 1);
}
Expand Down Expand Up @@ -330,11 +324,6 @@ int av_packet_merge_side_data(AVPacket *pkt){
return AVERROR(ENOMEM);
pkt->buf = buf;
pkt->data = p = buf->data;
#if FF_API_DESTRUCT_PACKET
FF_DISABLE_DEPRECATION_WARNINGS
pkt->destruct = dummy_destruct_packet;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
pkt->size = size - AV_INPUT_BUFFER_PADDING_SIZE;
bytestream_put_buffer(&p, old.data, old.size);
for (i=old.side_data_elems-1; i>=0; i--) {
Expand Down
15 changes: 0 additions & 15 deletions libavcodec/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1797,11 +1797,6 @@ int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int64
av_fast_padded_malloc(&avctx->internal->byte_buffer, &avctx->internal->byte_buffer_size, size);
avpkt->data = avctx->internal->byte_buffer;
avpkt->size = avctx->internal->byte_buffer_size;
#if FF_API_DESTRUCT_PACKET
FF_DISABLE_DEPRECATION_WARNINGS
avpkt->destruct = NULL;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
}
}

Expand Down Expand Up @@ -1972,11 +1967,6 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
}
avpkt->buf = user_pkt.buf;
avpkt->data = user_pkt.data;
#if FF_API_DESTRUCT_PACKET
FF_DISABLE_DEPRECATION_WARNINGS
avpkt->destruct = user_pkt.destruct;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
} else {
if (av_dup_packet(avpkt) < 0) {
ret = AVERROR(ENOMEM);
Expand Down Expand Up @@ -2197,11 +2187,6 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
}
avpkt->buf = user_pkt.buf;
avpkt->data = user_pkt.data;
#if FF_API_DESTRUCT_PACKET
FF_DISABLE_DEPRECATION_WARNINGS
avpkt->destruct = user_pkt.destruct;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
} else {
if (av_dup_packet(avpkt) < 0) {
ret = AVERROR(ENOMEM);
Expand Down
5 changes: 0 additions & 5 deletions libavdevice/iec61883.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,6 @@ static int iec61883_parse_queue_dv(struct iec61883_data *dv, AVPacket *pkt)

size = avpriv_dv_produce_packet(dv->dv_demux, pkt,
packet->buf, packet->len, -1);
#if FF_API_DESTRUCT_PACKET
FF_DISABLE_DEPRECATION_WARNINGS
pkt->destruct = av_destruct_packet;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
dv->queue_first = packet->next;
av_free(packet);
dv->packets--;
Expand Down
5 changes: 0 additions & 5 deletions libavformat/asfdec_f.c
Original file line number Diff line number Diff line change
Expand Up @@ -1420,11 +1420,6 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
}
asf_st->frag_offset = 0;
*pkt = asf_st->pkt;
#if FF_API_DESTRUCT_PACKET
FF_DISABLE_DEPRECATION_WARNINGS
asf_st->pkt.destruct = NULL;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
asf_st->pkt.buf = 0;
asf_st->pkt.size = 0;
asf_st->pkt.data = 0;
Expand Down
5 changes: 0 additions & 5 deletions libavformat/mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -1059,11 +1059,6 @@ int ff_write_chained(AVFormatContext *dst, int dst_stream, AVPacket *pkt,
pkt->buf = local_pkt.buf;
pkt->side_data = local_pkt.side_data;
pkt->side_data_elems = local_pkt.side_data_elems;
#if FF_API_DESTRUCT_PACKET
FF_DISABLE_DEPRECATION_WARNINGS
pkt->destruct = local_pkt.destruct;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
return ret;
}

Expand Down
8 changes: 1 addition & 7 deletions libavformat/tee.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,13 +396,7 @@ static int filter_packet(void *log_ctx, AVPacket *pkt,
&new_pkt.data, &new_pkt.size,
pkt->data, pkt->size,
pkt->flags & AV_PKT_FLAG_KEY);
FF_DISABLE_DEPRECATION_WARNINGS
if (ret == 0 && new_pkt.data != pkt->data
#if FF_API_DESTRUCT_PACKET
&& new_pkt.destruct
#endif
) {
FF_ENABLE_DEPRECATION_WARNINGS
if (ret == 0 && new_pkt.data != pkt->data) {
if ((ret = av_copy_packet(&new_pkt, pkt)) < 0)
break;
ret = 1;
Expand Down

0 comments on commit 83a5df5

Please sign in to comment.