History

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.

Anton Khirnov committed 4 years ago

Commit 14726571 parent 627543f4 files · +9 −0Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavformat/avformat.h +3 −0
  3. libavformat/mux_utils.c +2 −0
  4. libavformat/version_major.h +1 −0
doc/APIchanges+3−0
@@ -14,6 +14,9 @@ libavutil: 2021-04-27 · 13 unmodified lines
1414
1515 API changes, most recent first:
1616
17+2022-08-xx - xxxxxxxxxx - lavf 59 - avformat.h
18+ Deprecate av_stream_get_end_pts() without replacement.
19+
1720 2022-08-19 - 352799dca8 - lavc 59.42.102 - codec_id.h
1821 Deprecate AV_CODEC_ID_AYUV and ayuv decoder/encoder. The rawvideo codec
1922 and vuya pixel format combination will be used instead from now on.
libavformat/avformat.h+3−0
@@ -1121,12 +1121,15 @@ typedef struct AVStream { · 1120 unmodified lines
11211121
11221122 struct AVCodecParserContext *av_stream_get_parser(const AVStream *s);
11231123
1124+#if FF_API_GET_END_PTS
11241125 /**
11251126 * Returns the pts of the last muxed packet + its duration
11261127 *
11271128 * the retuned value is undefined when used with a demuxer.
11281129 */
1130+attribute_deprecated
11291131 int64_t av_stream_get_end_pts(const AVStream *st);
1132+#endif
11301133
11311134 #define AV_PROGRAM_RUNNING 1
11321135
libavformat/mux_utils.c+2−0
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #include "internal.h"
3030 #include "mux.h"
3131
32+#if FF_API_GET_END_PTS
3233 int64_t av_stream_get_end_pts(const AVStream *st)
3334 {
3435 if (cffstream(st)->priv_pts) {
@@ -36,6 +37,7 @@ int64_t av_stream_get_end_pts(const AVStream *st) · 1 unmodified line
3637 } else
3738 return AV_NOPTS_VALUE;
3839 }
40+#endif
3941
4042 int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id,
4143 int std_compliance)
libavformat/version_major.h+1−0
@@ -46,6 +46,7 @@ · 45 unmodified lines
4646 #define FF_API_AVIOCONTEXT_WRITTEN (LIBAVFORMAT_VERSION_MAJOR < 60)
4747 #define FF_HLS_TS_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 60)
4848 #define FF_API_AVSTREAM_CLASS (LIBAVFORMAT_VERSION_MAJOR > 59)
49+#define FF_API_GET_END_PTS (LIBAVFORMAT_VERSION_MAJOR < 60)
4950
5051
5152 #define FF_API_R_FRAME_RATE 1

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t