[FFmpeg-cvslog] add missing FF_API_DESTRUCT_PACKET guards
Andreas Cadhalpun
git at videolan.org
Sat Aug 22 19:16:25 CEST 2015
ffmpeg | branch: master | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Sat Aug 8 10:41:30 2015 +0200| [c363843a53553cbda6d42d98e8fbd165eda193fb] | committer: Andreas Cadhalpun
add missing FF_API_DESTRUCT_PACKET guards
Reviewed-by: wm4 <nfxjfg at googlemail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c363843a53553cbda6d42d98e8fbd165eda193fb
---
ffmpeg.c | 8 +++++++-
libavdevice/iec61883.c | 4 ++++
libavformat/mux.c | 4 ++++
libavformat/tee.c | 8 +++++++-
4 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/ffmpeg.c b/ffmpeg.c
index b84fb15..ae02b00 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -693,7 +693,13 @@ 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);
- if(a == 0 && new_pkt.data != pkt->data && new_pkt.destruct) {
+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
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);
diff --git a/libavdevice/iec61883.c b/libavdevice/iec61883.c
index 5c74cc7..8ee834e 100644
--- a/libavdevice/iec61883.c
+++ b/libavdevice/iec61883.c
@@ -198,7 +198,11 @@ 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--;
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 84c6d24..7664872 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -1045,7 +1045,11 @@ 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;
}
diff --git a/libavformat/tee.c b/libavformat/tee.c
index e3d466a..bc2e522 100644
--- a/libavformat/tee.c
+++ b/libavformat/tee.c
@@ -396,7 +396,13 @@ 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);
- if (ret == 0 && new_pkt.data != pkt->data && new_pkt.destruct) {
+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 = av_copy_packet(&new_pkt, pkt)) < 0)
break;
ret = 1;
More information about the ffmpeg-cvslog
mailing list