aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-08-22 18:14:15 +0200
committerPaul B Mahol <onemda@gmail.com>2019-08-28 16:27:58 +0200
commit428b4aacb1a91a267650de644519882a5f700388 (patch)
treebd84a5f223a61412d3fbf56e8a61a60f199ea34a
parentd063f13700aa86365589f49b697e8c42b9cae4ca (diff)
downloadffmpeg-428b4aacb1a91a267650de644519882a5f700388.tar.gz
avformat/mov: improve timecode calculation
Fixes timecode calculation for NTSC frame rates. Fixes ticket #5978.
-rw-r--r--libavformat/mov.c4
-rw-r--r--tests/ref/fate/copy-trac2362
2 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 8a4cdc4b43..675b915906 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2304,8 +2304,8 @@ static int mov_parse_stsd_data(MOVContext *c, AVIOContext *pb,
int val;
val = AV_RB32(st->codecpar->extradata + 4);
tmcd_ctx->tmcd_flags = val;
- st->avg_frame_rate.num = st->codecpar->extradata[16]; /* number of frame */
- st->avg_frame_rate.den = 1;
+ st->avg_frame_rate.num = AV_RB32(st->codecpar->extradata + 8); /* timescale */
+ st->avg_frame_rate.den = AV_RB32(st->codecpar->extradata + 12); /* frameDuration */
#if FF_API_LAVF_AVCTX
FF_DISABLE_DEPRECATION_WARNINGS
st->codec->time_base = av_inv_q(st->avg_frame_rate);
diff --git a/tests/ref/fate/copy-trac236 b/tests/ref/fate/copy-trac236
index 2ac05e63e6..1583ae5704 100644
--- a/tests/ref/fate/copy-trac236
+++ b/tests/ref/fate/copy-trac236
@@ -1,4 +1,4 @@
-959a4d78c6c11936e361fc3101a013eb *tests/data/fate/copy-trac236.mov
+984a33c6292e3d35e2cfdfbf66d8e82b *tests/data/fate/copy-trac236.mov
630860 tests/data/fate/copy-trac236.mov
#tb 0: 100/2997
#media_type 0: video