mirror of https://github.com/mpv-player/mpv
Fix OSD when switching subtitles - set the osd buffer to Subtitle: off
first, and then eventually set it to other values if some kind of subtitles is on. Otherwise 1) spudec stuff stomps on the buffer after vobsub, 2) Subtitle: off isn't displayed when cycling text subtitles. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15162 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
0f3c494307
commit
b3bd58219b
30
mplayer.c
30
mplayer.c
|
@ -3910,16 +3910,15 @@ if ((user_muted | edl_muted) != mixer.muted) mixer_mute(&mixer);
|
||||||
osd_show_sub_visibility--;
|
osd_show_sub_visibility--;
|
||||||
} else
|
} else
|
||||||
if (osd_show_vobsub_changed) {
|
if (osd_show_vobsub_changed) {
|
||||||
|
snprintf(osd_text_tmp, 63, "Subtitles: off");
|
||||||
if (vo_vobsub && vobsub_id >= 0) {
|
if (vo_vobsub && vobsub_id >= 0) {
|
||||||
const char *language = "none";
|
const char *language = "none";
|
||||||
language = vobsub_get_id(vo_vobsub, (unsigned int) vobsub_id);
|
language = vobsub_get_id(vo_vobsub, (unsigned int) vobsub_id);
|
||||||
snprintf(osd_text_tmp, 63, "Subtitles: (%d) %s", vobsub_id, language ? language : "unknown");
|
snprintf(osd_text_tmp, 63, "Subtitles: (%d) %s", vobsub_id, language ? language : "unknown");
|
||||||
}
|
}
|
||||||
#ifdef HAVE_OGGVORBIS
|
#ifdef HAVE_OGGVORBIS
|
||||||
if (d_dvdsub && demuxer->type == DEMUXER_TYPE_OGG) {
|
if (d_dvdsub && demuxer->type == DEMUXER_TYPE_OGG) {
|
||||||
if (dvdsub_id < 0)
|
if (dvdsub_id >= 0) {
|
||||||
snprintf(osd_text_tmp, 63, "Subtitles: (off)");
|
|
||||||
else {
|
|
||||||
char *lang = demux_ogg_sub_lang(demuxer, dvdsub_id);
|
char *lang = demux_ogg_sub_lang(demuxer, dvdsub_id);
|
||||||
if (!lang) lang = "unknown";
|
if (!lang) lang = "unknown";
|
||||||
snprintf(osd_text_tmp, 63, "Subtitles: (%d) %s", dvdsub_id, lang);
|
snprintf(osd_text_tmp, 63, "Subtitles: (%d) %s", dvdsub_id, lang);
|
||||||
|
@ -3928,15 +3927,17 @@ if ((user_muted | edl_muted) != mixer.muted) mixer_mute(&mixer);
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_DVDREAD
|
#ifdef USE_DVDREAD
|
||||||
if (vo_spudec && (demuxer->type != DEMUXER_TYPE_MATROSKA)) {
|
if (vo_spudec && (demuxer->type != DEMUXER_TYPE_MATROSKA)) {
|
||||||
char lang[5] = "none";
|
if (dvdsub_id >= 0) {
|
||||||
int code = 0;
|
char lang[5] = "none";
|
||||||
if (dvdsub_id >= 0) code = dvd_lang_from_sid(stream, dvdsub_id);
|
int code = 0;
|
||||||
if (code) {
|
code = dvd_lang_from_sid(stream, dvdsub_id);
|
||||||
lang[0] = code >> 8;
|
if (code) {
|
||||||
lang[1] = code;
|
lang[0] = code >> 8;
|
||||||
lang[2] = 0;
|
lang[1] = code;
|
||||||
|
lang[2] = 0;
|
||||||
|
}
|
||||||
|
snprintf(osd_text_tmp, 63, "Subtitles: (%d) %s", dvdsub_id, lang);
|
||||||
}
|
}
|
||||||
snprintf(osd_text_tmp, 63, "Subtitles: (%d) %s", dvdsub_id, lang);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_MATROSKA
|
#ifdef HAVE_MATROSKA
|
||||||
|
@ -3945,9 +3946,8 @@ if ((user_muted | edl_muted) != mixer.muted) mixer_mute(&mixer);
|
||||||
if (dvdsub_id >= 0) {
|
if (dvdsub_id >= 0) {
|
||||||
demux_mkv_get_sub_lang(demuxer, dvdsub_id, lang, 9);
|
demux_mkv_get_sub_lang(demuxer, dvdsub_id, lang, 9);
|
||||||
lang[9] = 0;
|
lang[9] = 0;
|
||||||
} else
|
snprintf(osd_text_tmp, 63, "Subtitles: (%d) %s", dvdsub_id, lang);
|
||||||
strcpy(lang, "off");
|
}
|
||||||
snprintf(osd_text_tmp, 63, "Subtitles: (%d) %s", dvdsub_id, lang);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
osd_show_vobsub_changed--;
|
osd_show_vobsub_changed--;
|
||||||
|
|
Loading…
Reference in New Issue