aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-09-29 15:14:59 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2015-09-29 15:22:52 +0200
commitb01891a9f08b9d271d75d179b3138242a958ee04 (patch)
tree6180f466be7e17e8059b3ab69a1fb5d95e776e32 /libavcodec
parentd3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b (diff)
parent948f3c19a8bd069768ca411212aaf8c1ed96b10d (diff)
downloadffmpeg-b01891a9f08b9d271d75d179b3138242a958ee04.tar.gz
Merge commit '948f3c19a8bd069768ca411212aaf8c1ed96b10d'
* commit '948f3c19a8bd069768ca411212aaf8c1ed96b10d': lavc: Make AVPacket.duration int64, and deprecate convergence_duration Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/audio_frame_queue.c2
-rw-r--r--libavcodec/audio_frame_queue.h2
-rw-r--r--libavcodec/avcodec.h42
-rw-r--r--libavcodec/avpacket.c12
-rw-r--r--libavcodec/parser.c5
-rw-r--r--libavcodec/version.h3
6 files changed, 33 insertions, 33 deletions
diff --git a/libavcodec/audio_frame_queue.c b/libavcodec/audio_frame_queue.c
index 4f6bccce36..f2ccd69281 100644
--- a/libavcodec/audio_frame_queue.c
+++ b/libavcodec/audio_frame_queue.c
@@ -73,7 +73,7 @@ int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f)
}
void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts,
- int *duration)
+ int64_t *duration)
{
int64_t out_pts = AV_NOPTS_VALUE;
int removed_samples = 0;
diff --git a/libavcodec/audio_frame_queue.h b/libavcodec/audio_frame_queue.h
index 2e317bbf41..d8076eae54 100644
--- a/libavcodec/audio_frame_queue.h
+++ b/libavcodec/audio_frame_queue.h
@@ -78,6 +78,6 @@ int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f);
* @param[out] duration output packet duration
*/
void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts,
- int *duration);
+ int64_t *duration);
#endif /* AVCODEC_AUDIO_FRAME_QUEUE_H */
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 872a9a5ee4..138627d8d4 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1411,28 +1411,19 @@ typedef struct AVPacket {
* Duration of this packet in AVStream->time_base units, 0 if unknown.
* Equals next_pts - this_pts in presentation order.
*/
- int duration;
+ int64_t duration;
int64_t pos; ///< byte position in stream, -1 if unknown
+#if FF_API_CONVERGENCE_DURATION
/**
- * Time difference in AVStream->time_base units from the pts of this
- * packet to the point at which the output from the decoder has converged
- * independent from the availability of previous frames. That is, the
- * frames are virtually identical no matter if decoding started from
- * the very first frame or from this keyframe.
- * Is AV_NOPTS_VALUE if unknown.
- * This field is not the display duration of the current packet.
- * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY
- * set.
- *
- * The purpose of this field is to allow seeking in streams that have no
- * keyframes in the conventional sense. It corresponds to the
- * recovery point SEI in H.264 and match_time_delta in NUT. It is also
- * essential for some types of subtitle streams to ensure that all
- * subtitles are correctly displayed after seeking.
+ * @deprecated Same as the duration field, but as int64_t. This was required
+ * for Matroska subtitles, whose duration values could overflow when the
+ * duration field was still an int.
*/
+ attribute_deprecated
int64_t convergence_duration;
+#endif
} AVPacket;
#define AV_PKT_FLAG_KEY 0x0001 ///< The packet contains a keyframe
#define AV_PKT_FLAG_CORRUPT 0x0002 ///< The packet content is corrupted
@@ -4325,24 +4316,13 @@ typedef struct AVCodecParserContext {
*/
int key_frame;
+#if FF_API_CONVERGENCE_DURATION
/**
- * Time difference in stream time base units from the pts of this
- * packet to the point at which the output from the decoder has converged
- * independent from the availability of previous frames. That is, the
- * frames are virtually identical no matter if decoding started from
- * the very first frame or from this keyframe.
- * Is AV_NOPTS_VALUE if unknown.
- * This field is not the display duration of the current frame.
- * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY
- * set.
- *
- * The purpose of this field is to allow seeking in streams that have no
- * keyframes in the conventional sense. It corresponds to the
- * recovery point SEI in H.264 and match_time_delta in NUT. It is also
- * essential for some types of subtitle streams to ensure that all
- * subtitles are correctly displayed after seeking.
+ * @deprecated unused
*/
+ attribute_deprecated
int64_t convergence_duration;
+#endif
// Timestamp generation support:
/**
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 32fa51f24f..0496254cf4 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -36,7 +36,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;
@@ -468,7 +472,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;
@@ -540,8 +548,12 @@ 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
}
int ff_side_data_set_encoder_stats(AVPacket *pkt, int quality, int64_t *error, int error_count, int pict_type)
diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index f5bfa249d9..2809158c35 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -25,6 +25,7 @@
#include "libavutil/avassert.h"
#include "libavutil/atomic.h"
+#include "libavutil/internal.h"
#include "libavutil/mem.h"
#include "internal.h"
@@ -82,7 +83,11 @@ found:
goto err_out;
}
s->key_frame = -1;
+#if FF_API_CONVERGENCE_DURATION
+FF_DISABLE_DEPRECATION_WARNINGS
s->convergence_duration = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
s->dts_sync_point = INT_MIN;
s->dts_ref_dts_delta = INT_MIN;
s->pts_dts_delta = INT_MIN;
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 676099ccee..9c0ed3492a 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -185,5 +185,8 @@
#ifndef FF_API_VDPAU_PROFILE
#define FF_API_VDPAU_PROFILE (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
+#ifndef FF_API_CONVERGENCE_DURATION
+#define FF_API_CONVERGENCE_DURATION (LIBAVCODEC_VERSION_MAJOR < 59)
+#endif
#endif /* AVCODEC_VERSION_H */