aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-23 22:08:13 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-23 22:36:02 +0200
commit3bf57acb9cb2a337903ad03dfef445a337d5a676 (patch)
treea078d0ce873f48ab178d74f44e5fafef7b70a877
parentde0d3fe562e25560d0fe4e2b6902e5878a2a63cc (diff)
downloadffmpeg-3bf57acb9cb2a337903ad03dfef445a337d5a676.tar.gz
avformat/4xm: Change fps to AVRational
This fixes the video timebase as well Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/4xm.c8
-rw-r--r--tests/ref/fate/4xm-22
2 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index 240e5a40ea..8fdad185f4 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -77,7 +77,7 @@ typedef struct FourxmDemuxContext {
AudioTrack *tracks;
int64_t video_pts;
- float fps;
+ AVRational fps;
} FourxmDemuxContext;
static int fourxm_probe(AVProbeData *p)
@@ -104,7 +104,7 @@ static int parse_vtrk(AVFormatContext *s,
if (!st)
return AVERROR(ENOMEM);
- avpriv_set_pts_info(st, 60, 1, fourxm->fps);
+ avpriv_set_pts_info(st, 60, fourxm->fps.den, fourxm->fps.num);
fourxm->video_stream_index = st->index;
@@ -206,7 +206,7 @@ static int fourxm_read_header(AVFormatContext *s)
fourxm->track_count = 0;
fourxm->tracks = NULL;
- fourxm->fps = 1.0;
+ fourxm->fps = (AVRational){1,1};
/* skip the first 3 32-bit numbers */
avio_skip(pb, 12);
@@ -241,7 +241,7 @@ static int fourxm_read_header(AVFormatContext *s)
ret = AVERROR_INVALIDDATA;
goto fail;
}
- fourxm->fps = av_int2float(AV_RL32(&header[i + 12]));
+ fourxm->fps = av_d2q(av_int2float(AV_RL32(&header[i + 12])), 10000);
} else if (fourcc_tag == vtrk_TAG) {
if ((ret = parse_vtrk(s, fourxm, header + i, size,
header_size - i)) < 0)
diff --git a/tests/ref/fate/4xm-2 b/tests/ref/fate/4xm-2
index cf71357810..6895d124d9 100644
--- a/tests/ref/fate/4xm-2
+++ b/tests/ref/fate/4xm-2
@@ -1,4 +1,4 @@
-#tb 0: 1/6
+#tb 0: 4/25
0, 0, 0, 1, 80640, 0x00000000
0, 1, 1, 1, 80640, 0x3a942680
0, 2, 2, 1, 80640, 0x3a942680