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.
This commit is contained in:
wm4 2014-09-25 20:16:03 +02:00
parent debbff76f9
commit 5116c6c242
1 changed files with 3 additions and 0 deletions

View File

@ -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);
}