path: root/player/sub.c
diff options
authorwm4 <wm4@nowhere>2014-09-25 20:16:03 +0200
committerwm4 <wm4@nowhere>2014-09-25 21:32:56 +0200
commit5116c6c242dc2bd9c4f975605b9b07810c7420c2 (patch)
tree430ef9e11e58291322e7b8a58fe45bbabc70a3b9 /player/sub.c
parentdebbff76f9b97f77ffa6249e92d2573548a99a40 (diff)
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.
Diffstat (limited to 'player/sub.c')
1 files changed, 3 insertions, 0 deletions
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);