aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-02-02 23:37:03 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-02-02 23:37:03 +0000
commit33abc1a73afe15255d399953810fdd9c7c453dd5 (patch)
tree0e2630191b8c863c256034d97197acc18af46def
parentbe62f5569e40a578ffed8662c4f98182c0a15fe3 (diff)
downloadffmpeg-33abc1a73afe15255d399953810fdd9c7c453dd5.tar.gz
be more flexible with frame rate check
Originally committed as revision 16965 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/mxfenc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index df7cb3eecf..b5f3aa52d7 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -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 {