summaryrefslogtreecommitdiff
path: root/libavcodec/avpacket.c
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2015-09-26 18:13:55 +0200
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-09-29 14:33:00 +0200
commit948f3c19a8bd069768ca411212aaf8c1ed96b10d (patch)
tree159e78bd8057aa0d7ff10fac4577ce8bb5170576 /libavcodec/avpacket.c
parentd00bb8addccb63fa3feacb06d2a310731dc0113b (diff)
lavc: Make AVPacket.duration int64, and deprecate convergence_duration
Note that convergence_duration had another meaning, one which was in practice never used. The only real use for it was a 64 bit replacement for the duration field. It's better just to make duration 64 bits, and to get rid of it. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/avpacket.c')
-rw-r--r--libavcodec/avpacket.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index dfaf045036..e762a8782a 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -34,7 +34,11 @@ void av_init_packet(AVPacket *pkt)
pkt->dts = AV_NOPTS_VALUE;
pkt->pos = -1;
pkt->duration = 0;
+#if FF_API_CONVERGENCE_DURATION
+FF_DISABLE_DEPRECATION_WARNINGS
pkt->convergence_duration = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
pkt->flags = 0;
pkt->stream_index = 0;
pkt->buf = NULL;
@@ -269,7 +273,11 @@ int av_packet_copy_props(AVPacket *dst, const AVPacket *src)
dst->dts = src->dts;
dst->pos = src->pos;
dst->duration = src->duration;
+#if FF_API_CONVERGENCE_DURATION
+FF_DISABLE_DEPRECATION_WARNINGS
dst->convergence_duration = src->convergence_duration;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
dst->flags = src->flags;
dst->stream_index = src->stream_index;
@@ -341,6 +349,10 @@ void av_packet_rescale_ts(AVPacket *pkt, AVRational src_tb, AVRational dst_tb)
pkt->dts = av_rescale_q(pkt->dts, src_tb, dst_tb);
if (pkt->duration > 0)
pkt->duration = av_rescale_q(pkt->duration, src_tb, dst_tb);
+#if FF_API_CONVERGENCE_DURATION
+FF_DISABLE_DEPRECATION_WARNINGS
if (pkt->convergence_duration > 0)
pkt->convergence_duration = av_rescale_q(pkt->convergence_duration, src_tb, dst_tb);
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
}