diff mbox series

[FFmpeg-devel,2/4] avutil/timestamp: Constify av_ts_make_time_string()

Message ID AS8P250MB0744E2A669A81FDD7516EE2D8F582@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Headers show
Series [FFmpeg-devel,1/4] avformat/avio: Make avio_print_string_array() accept const pointers | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Feb. 28, 2024, 7:07 p.m. UTC
(Actually, the time base should be passed by value.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 doc/APIchanges        | 3 +++
 libavutil/timestamp.h | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/doc/APIchanges b/doc/APIchanges
index 055e6848a3..2fca5b7ea8 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,9 @@  The last version increases of all libraries were on 2023-02-09
 
 API changes, most recent first:
 
+2024-02-28 - xxxxxxxxxx - lavu 58.xx.100 - timestamp.h
+  av_ts_make_time_string() now accepts a pointer to const AVRational.
+
 2024-02-28 - xxxxxxxxxx - lavf 60.xx.100 - avio.h
   avio_print_string_array() now accepts an array of const pointers.
 
diff --git a/libavutil/timestamp.h b/libavutil/timestamp.h
index 9ae64da8a1..2b37781eba 100644
--- a/libavutil/timestamp.h
+++ b/libavutil/timestamp.h
@@ -62,7 +62,8 @@  static inline char *av_ts_make_string(char *buf, int64_t ts)
  * @param tb the timebase of the timestamp
  * @return the buffer in input
  */
-static inline char *av_ts_make_time_string(char *buf, int64_t ts, AVRational *tb)
+static inline char *av_ts_make_time_string(char *buf, int64_t ts,
+                                           const AVRational *tb)
 {
     if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
     else                      snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.6g", av_q2d(*tb) * ts);