]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
be more flexible with frame rate check
authorbcoudurier <bcoudurier@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 2 Feb 2009 23:37:03 +0000 (23:37 +0000)
committerbcoudurier <bcoudurier@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 2 Feb 2009 23:37:03 +0000 (23:37 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@16965 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavformat/mxfenc.c

index df7cb3eecf30388682ec0b2443dc24ef4ff8d5cd..b5f3aa52d7f5ba4e4bd24115bb9002792af2955c 100644 (file)
@@ -32,6 +32,8 @@
 
 //#define DEBUG
 
+#include <math.h>
+
 #include "libavutil/fifo.h"
 #include "mxf.h"
 
@@ -1117,10 +1119,10 @@ static int mxf_write_header(AVFormatContext *s)
         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 {