lavu/rational: add syntactic sugar.
Add a function to create a rational and macros for common values.
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user