changeset 4363:8142fb82cd75 libavformat

be more flexible with frame rate check
author bcoudurier
date Mon, 02 Feb 2009 23:37:03 +0000
parents 20a889f18f23
children 52e876e7c0cf
files mxfenc.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mxfenc.c	Mon Feb 02 23:25:02 2009 +0000
+++ b/mxfenc.c	Mon Feb 02 23:37:03 2009 +0000
@@ -32,6 +32,8 @@
 
 //#define DEBUG
 
+#include <math.h>
+
 #include "libavutil/fifo.h"
 #include "mxf.h"
 
@@ -1117,10 +1119,10 @@
         st->priv_data = sc;
 
         if (st->codec->codec_type == CODEC_TYPE_VIDEO) {
-            if (!av_cmp_q(st->codec->time_base, (AVRational){ 1, 25 })) {
+            if (fabs(av_q2d(st->codec->time_base) - 1/25.0) < 0.0001) {
                 samples_per_frame = PAL_samples_per_frame;
                 mxf->time_base = (AVRational){ 1, 25 };
-            } else if (!av_cmp_q(st->codec->time_base, (AVRational){ 1001, 30000 })) {
+            } else if (fabs(av_q2d(st->codec->time_base) - 1001/30000.0) < 0.0001) {
                 samples_per_frame = NTSC_samples_per_frame;
                 mxf->time_base = (AVRational){ 1001, 30000 };
             } else {