summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-03-04 00:28:10 +0100
committerwm4 <wm4@nowhere>2014-03-04 00:28:10 +0100
commit5606cf29482b096df7a6b4b515c9ecb3d40fdf89 (patch)
tree94445a6a8ffe27ccaed6c39677f1478a37950580 /sub
parent43e997ca07f43598f49e1a0f1f3c52e08a9179f3 (diff)
downloadmpv-5606cf29482b096df7a6b4b515c9ecb3d40fdf89.tar.bz2
mpv-5606cf29482b096df7a6b4b515c9ecb3d40fdf89.tar.xz
sub: use new FFmpeg API to check MicroDVD FPS
Before this, it wasn't possible to distinguish MicroDVD subtitles without FPS header, and subtitles with FPS header equal to FFmpeg's fallback FPS.
Diffstat (limited to 'sub')
-rw-r--r--sub/dec_sub.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sub/dec_sub.c b/sub/dec_sub.c
index fdb8d8f648..0a62e52a15 100644
--- a/sub/dec_sub.c
+++ b/sub/dec_sub.c
@@ -464,9 +464,11 @@ bool sub_read_all_packets(struct dec_sub *sub, struct sh_stream *sh)
double sub_speed = 1.0;
- // 23.976 FPS is used as default timebase for frame based formats
- if (sub->video_fps && sh->sub->frame_based)
- sub_speed *= 23.976 / sub->video_fps;
+ if (sub->video_fps && sh->sub->frame_based > 0) {
+ MP_VERBOSE(sub, "Frame based format, dummy FPS: %f, video FPS: %f\n",
+ sh->sub->frame_based, sub->video_fps);
+ sub_speed *= sh->sub->frame_based / sub->video_fps;
+ }
if (opts->sub_fps && sub->video_fps)
sub_speed *= opts->sub_fps / sub->video_fps;