From 5606cf29482b096df7a6b4b515c9ecb3d40fdf89 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 4 Mar 2014 00:28:10 +0100 Subject: 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. --- sub/dec_sub.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sub/dec_sub.c') 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; -- cgit v1.2.3