From 5116c6c242dc2bd9c4f975605b9b07810c7420c2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 25 Sep 2014 20:16:03 +0200 Subject: sub: approximate subtitle display in no-video mode This makes subtitle display somewhat work if no video is displayed, but a VO window exists (--force-window or cover art display). The main problem with normal subtitle display is that it's locked to video: it uses the video PTS as reference, and the subtitles advance only if a new video frame is displayed. In audio-only mode on the other hand, no video frame is ever displayed (or only 1 in the cover art case). You would need a workaround to adjust the subtitle PTS, and you would have to decide with what frequency to update the display. In general, there is no "right" display FPS for subtitles. Some formats (ASS) have animations parameterized by time, and any refresh rate could be used. Sidestep these problems by enabling the text OSD-based subtitle mechanism. This is similar to --no-sub-ass, and updates and renders subtitles with plain OSD. It has some caveats: no bitmap subs, somewhat incorrect timing, no formatting. Timing in particular is a bit strange and depends how often the audio output asks for new data, or other events that happen to wakeup the playloop. --- player/sub.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'player/sub.c') diff --git a/player/sub.c b/player/sub.c index 0de6c2bbf1..8f5f8ad8ac 100644 --- a/player/sub.c +++ b/player/sub.c @@ -227,5 +227,8 @@ void reinit_subs(struct MPContext *mpctx, int order) if (order == 1 && sub_has_get_text(dec_sub)) state.render_bitmap_subs = false; + if (!mpctx->current_track[0][STREAM_VIDEO]) + state.render_bitmap_subs = false; + osd_set_sub(mpctx->osd, obj, &state); } -- cgit v1.2.3