diff options
author | Anton Khirnov <anton@khirnov.net> | 2022-08-17 15:37:52 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2022-08-22 11:35:43 +0200 |
commit | 14726571ddbf5981a1eeadf3c06eeb44b89589ae (patch) | |
tree | 37933d0af31ab883b6d25ebf50b79aaf1bd7e994 | |
parent | 627543f58a3166810b9cd9c8b483678c82a99be9 (diff) |
lavf: deprecate av_stream_get_end_pts()
According to its documentation it returns "pts of the last muxed packet
+ its duration", but the value it actually returns right now is
(possibly guessed) dts after muxer-internal bitstream filtering (if
any).
This function was added for ffmpeg.c, but it is not used there anymore.
Since the value it returns is ill-defined and so inappropriate for any
serious use, deprecate it.
-rw-r--r-- | doc/APIchanges | 3 | ||||
-rw-r--r-- | libavformat/avformat.h | 3 | ||||
-rw-r--r-- | libavformat/mux_utils.c | 2 | ||||
-rw-r--r-- | libavformat/version_major.h | 1 |
4 files changed, 9 insertions, 0 deletions
diff --git a/doc/APIchanges b/doc/APIchanges index 2df65a521d..4c0c9db628 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -14,6 +14,9 @@ libavutil: 2021-04-27 API changes, most recent first: +2022-08-xx - xxxxxxxxxx - lavf 59 - avformat.h + Deprecate av_stream_get_end_pts() without replacement. + 2022-08-19 - 352799dca8 - lavc 59.42.102 - codec_id.h Deprecate AV_CODEC_ID_AYUV and ayuv decoder/encoder. The rawvideo codec and vuya pixel format combination will be used instead from now on. diff --git a/libavformat/avformat.h b/libavformat/avformat.h index f12fa7d904..9d46875cce 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1121,12 +1121,15 @@ typedef struct AVStream { struct AVCodecParserContext *av_stream_get_parser(const AVStream *s); +#if FF_API_GET_END_PTS /** * Returns the pts of the last muxed packet + its duration * * the retuned value is undefined when used with a demuxer. */ +attribute_deprecated int64_t av_stream_get_end_pts(const AVStream *st); +#endif #define AV_PROGRAM_RUNNING 1 diff --git a/libavformat/mux_utils.c b/libavformat/mux_utils.c index 2fa2ab5b0f..8b95fc5e7e 100644 --- a/libavformat/mux_utils.c +++ b/libavformat/mux_utils.c @@ -29,6 +29,7 @@ #include "internal.h" #include "mux.h" +#if FF_API_GET_END_PTS int64_t av_stream_get_end_pts(const AVStream *st) { if (cffstream(st)->priv_pts) { @@ -36,6 +37,7 @@ int64_t av_stream_get_end_pts(const AVStream *st) } else return AV_NOPTS_VALUE; } +#endif int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id, int std_compliance) diff --git a/libavformat/version_major.h b/libavformat/version_major.h index 5f71298bcc..099a17873f 100644 --- a/libavformat/version_major.h +++ b/libavformat/version_major.h @@ -46,6 +46,7 @@ #define FF_API_AVIOCONTEXT_WRITTEN (LIBAVFORMAT_VERSION_MAJOR < 60) #define FF_HLS_TS_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 60) #define FF_API_AVSTREAM_CLASS (LIBAVFORMAT_VERSION_MAJOR > 59) +#define FF_API_GET_END_PTS (LIBAVFORMAT_VERSION_MAJOR < 60) #define FF_API_R_FRAME_RATE 1 |