summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-06-23 22:14:43 +0200
committerwm4 <wm4@nowhere>2013-06-25 00:11:56 +0200
commitfeb64c2717139f030974823756f51cbe215ef818 (patch)
treef115c16e08d6f1f6d8738dcf2d3f1f5fb2554dfe /sub
parentcfa45c40dc0cfe44b699029168b62d4d3e16c288 (diff)
downloadmpv-feb64c2717139f030974823756f51cbe215ef818.tar.bz2
mpv-feb64c2717139f030974823756f51cbe215ef818.tar.xz
sub: attempt to use video FPS for frame based subtitle formats
This only affects demux_subreader.c for now. Maybe there is some hope this can be used for libavformat demuxers too, but I'm not sure yet.
Diffstat (limited to 'sub')
-rw-r--r--sub/dec_sub.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sub/dec_sub.c b/sub/dec_sub.c
index dd1168d0ad..54f3c1ebfe 100644
--- a/sub/dec_sub.c
+++ b/sub/dec_sub.c
@@ -275,6 +275,10 @@ bool sub_read_all_packets(struct dec_sub *sub, struct sh_sub *sh)
MP_TARRAY_APPEND(tmp, subs.packets, subs.num_packets, pkt);
}
+ // 23.976 FPS is used as default timebase for frame based formats
+ if (sub->video_fps && sh->frame_based)
+ multiply_timings(&subs, sub->video_fps / 23.976);
+
if (opts->sub_fps && sub->video_fps)
multiply_timings(&subs, opts->sub_fps / sub->video_fps);