diff mbox series

[FFmpeg-devel,v4,1/7] avformat/imf: relocate static function imf_time_to_ts()

Message ID 20220311171653.17420-1-pal@sandflow.com
State New
Headers show
Series [FFmpeg-devel,v4,1/7] avformat/imf: relocate static function imf_time_to_ts() | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Pierre-Anthony Lemieux March 11, 2022, 5:16 p.m. UTC
From: Pierre-Anthony Lemieux <pal@palemieux.com>

---
 libavformat/imfdec.c | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

Comments

Zane van Iperen March 12, 2022, 2:36 a.m. UTC | #1
lgtm. Will apply in a few days.
diff mbox series

Patch

diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c
index 3ce850b75a..b98af020d2 100644
--- a/libavformat/imfdec.c
+++ b/libavformat/imfdec.c
@@ -154,6 +154,25 @@  static int imf_uri_is_dos_abs_path(const char *string)
     return 0;
 }
 
+static int imf_time_to_ts(int64_t *ts, AVRational t, AVRational time_base)
+{
+    int dst_num;
+    int dst_den;
+    AVRational r;
+
+    r = av_div_q(t, time_base);
+
+    if ((av_reduce(&dst_num, &dst_den, r.num, r.den, INT64_MAX) != 1))
+        return 1;
+
+    if (dst_den != 1)
+        return 1;
+
+    *ts = dst_num;
+
+    return 0;
+}
+
 /**
  * Parse a ASSETMAP XML file to extract the UUID-URI mapping of assets.
  * @param s the current format context, if any (can be NULL).
@@ -772,25 +791,6 @@  static int get_resource_context_for_timestamp(AVFormatContext *s, IMFVirtualTrac
     return AVERROR_STREAM_NOT_FOUND;
 }
 
-static int imf_time_to_ts(int64_t *ts, AVRational t, AVRational time_base)
-{
-    int dst_num;
-    int dst_den;
-    AVRational r;
-
-    r = av_div_q(t, time_base);
-
-    if ((av_reduce(&dst_num, &dst_den, r.num, r.den, INT64_MAX) != 1))
-        return 1;
-
-    if (dst_den != 1)
-        return 1;
-
-    *ts = dst_num;
-
-    return 0;
-}
-
 static int imf_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
     IMFVirtualTrackResourcePlaybackCtx *resource = NULL;