Merge commit 'a18ef7a76c735bcf78ed4825e33ad7f9f6f77a54'
[ffmpeg.git] / libavutil / rational.h
index b9800ee..7439701 100644 (file)
@@ -45,6 +45,17 @@ typedef struct AVRational{
     int den; ///< denominator
 } AVRational;
 
+/**
+ * Create a rational.
+ * Useful for compilers that do not support compound literals.
+ * @note  The return value is not reduced.
+ */
+static inline AVRational av_make_q(int num, int den)
+{
+    AVRational r = { num, den };
+    return r;
+}
+
 /**
  * Compare two rationals.
  * @param a first rational