summaryrefslogtreecommitdiffstats
path: root/mpcommon.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-09-23 21:48:48 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-09-23 21:48:48 +0000
commit4b182ff652ee52647913a065801df12c99989173 (patch)
treee9b5693d12b1ed049220de74eeeae524df73dbff /mpcommon.c
parent1b927153645d10acd173d6909f19acc27f728536 (diff)
downloadmpv-4b182ff652ee52647913a065801df12c99989173.tar.bz2
mpv-4b182ff652ee52647913a065801df12c99989173.tar.xz
Add support for displaying subtitles on the command-line when playing
audio-only files. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29712 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mpcommon.c')
-rw-r--r--mpcommon.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/mpcommon.c b/mpcommon.c
index e28614390d..162dbbf26e 100644
--- a/mpcommon.c
+++ b/mpcommon.c
@@ -75,8 +75,7 @@ void update_subtitles(sh_video_t *sh_video, double refpts, demux_stream_t *d_dvd
if (reset) {
sub_clear_text(&subs, MP_NOPTS_VALUE);
if (vo_sub) {
- vo_sub = NULL;
- vo_osd_changed(OSDTYPE_SUBTITLE);
+ set_osd_subtitle(NULL);
}
if (vo_spudec) {
spudec_reset(vo_spudec);
@@ -145,7 +144,6 @@ void update_subtitles(sh_video_t *sh_video, double refpts, demux_stream_t *d_dvd
} else if (dvdsub_id >= 0 && (type == 't' || type == 'm' || type == 'a')) {
double curpts = refpts + sub_delay;
double endpts;
- vo_sub = &subs;
while (d_dvdsub->first) {
double subpts = ds_get_next_pts(d_dvdsub);
if (subpts > curpts)
@@ -167,7 +165,6 @@ void update_subtitles(sh_video_t *sh_video, double refpts, demux_stream_t *d_dvd
(long long)(subpts*1000 + 0.5),
(long long)((endpts-subpts)*1000 + 0.5));
} else { // plaintext subs with libass
- vo_sub = NULL;
if (subpts != MP_NOPTS_VALUE) {
if (endpts == MP_NOPTS_VALUE) endpts = subpts + 3;
sub_clear_text(&subs, MP_NOPTS_VALUE);
@@ -195,11 +192,11 @@ void update_subtitles(sh_video_t *sh_video, double refpts, demux_stream_t *d_dvd
packet = p;
}
sub_add_text(&subs, packet, len, endpts);
- vo_osd_changed(OSDTYPE_SUBTITLE);
+ set_osd_subtitle(&subs);
}
}
if (sub_clear_text(&subs, curpts))
- vo_osd_changed(OSDTYPE_SUBTITLE);
+ set_osd_subtitle(&subs);
}
current_module=NULL;
}