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.
Unified · Split
| @@ -14,6 +14,9 @@ libavutil: 2021-04-27 · 13 unmodified lines | ||
| 14 | 14 | |
| 15 | 15 | API changes, most recent first: |
| 16 | 16 | |
| 17 | +2022-08-xx - xxxxxxxxxx - lavf 59 - avformat.h | |
| 18 | + Deprecate av_stream_get_end_pts() without replacement. | |
| 19 | + | |
| 17 | 20 | 2022-08-19 - 352799dca8 - lavc 59.42.102 - codec_id.h |
| 18 | 21 | Deprecate AV_CODEC_ID_AYUV and ayuv decoder/encoder. The rawvideo codec |
| 19 | 22 | and vuya pixel format combination will be used instead from now on. |
| @@ -1121,12 +1121,15 @@ typedef struct AVStream { · 1120 unmodified lines | ||
| 1121 | 1121 | |
| 1122 | 1122 | struct AVCodecParserContext *av_stream_get_parser(const AVStream *s); |
| 1123 | 1123 | |
| 1124 | +#if FF_API_GET_END_PTS | |
| 1124 | 1125 | /** |
| 1125 | 1126 | * Returns the pts of the last muxed packet + its duration |
| 1126 | 1127 | * |
| 1127 | 1128 | * the retuned value is undefined when used with a demuxer. |
| 1128 | 1129 | */ |
| 1130 | +attribute_deprecated | |
| 1129 | 1131 | int64_t av_stream_get_end_pts(const AVStream *st); |
| 1132 | +#endif | |
| 1130 | 1133 | |
| 1131 | 1134 | #define AV_PROGRAM_RUNNING 1 |
| 1132 | 1135 | |
| @@ -29,6 +29,7 @@ · 28 unmodified lines | ||
| 29 | 29 | #include "internal.h" |
| 30 | 30 | #include "mux.h" |
| 31 | 31 | |
| 32 | +#if FF_API_GET_END_PTS | |
| 32 | 33 | int64_t av_stream_get_end_pts(const AVStream *st) |
| 33 | 34 | { |
| 34 | 35 | if (cffstream(st)->priv_pts) { |
| @@ -36,6 +37,7 @@ int64_t av_stream_get_end_pts(const AVStream *st) · 1 unmodified line | ||
| 36 | 37 | } else |
| 37 | 38 | return AV_NOPTS_VALUE; |
| 38 | 39 | } |
| 40 | +#endif | |
| 39 | 41 | |
| 40 | 42 | int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id, |
| 41 | 43 | int std_compliance) |
| @@ -46,6 +46,7 @@ · 45 unmodified lines | ||
| 46 | 46 | #define FF_API_AVIOCONTEXT_WRITTEN (LIBAVFORMAT_VERSION_MAJOR < 60) |
| 47 | 47 | #define FF_HLS_TS_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 60) |
| 48 | 48 | #define FF_API_AVSTREAM_CLASS (LIBAVFORMAT_VERSION_MAJOR > 59) |
| 49 | +#define FF_API_GET_END_PTS (LIBAVFORMAT_VERSION_MAJOR < 60) | |
| 49 | 50 | |
| 50 | 51 | |
| 51 | 52 | #define FF_API_R_FRAME_RATE 1 |