From 78b0182375e5d4eb27b044d976d40b3b5cd4c60d Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 7 Feb 2010 16:26:50 +0000 Subject: av_compare_ts() Originally committed as revision 21671 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavutil/mathematics.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libavutil/mathematics.h') diff --git a/libavutil/mathematics.h b/libavutil/mathematics.h index 12cd369036..29b13f77ed 100644 --- a/libavutil/mathematics.h +++ b/libavutil/mathematics.h @@ -80,4 +80,13 @@ int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding) av_cons */ int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const; +/** + * Compares 2 timestamps each in its own timebases. + * The result of the function is undefined if one of the timestamps + * is outside the int64_t range when represented in the others timebase. + * @returns -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position + */ +int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b); + + #endif /* AVUTIL_MATHEMATICS_H */ -- cgit v1.2.3