summaryrefslogtreecommitdiffstats
path: root/mencoder.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-10-06 04:28:59 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-10-06 04:48:00 +0300
commit7fd3eb0f74e7986e07556077ed654bad7869add8 (patch)
tree8d293145c0ef2bc31ca63f79dccb4e3b57294c82 /mencoder.c
parentef438b3a6b5bc714d521dd46d3ccb798ecd31eed (diff)
parentcbbc886820e981f488660708678f528e1d243121 (diff)
downloadmpv-7fd3eb0f74e7986e07556077ed654bad7869add8.tar.bz2
mpv-7fd3eb0f74e7986e07556077ed654bad7869add8.tar.xz
Merge svn changes up to r29752
As part of merging subtitle-in-terminal changes make update_subtitles() only clear existing subtitles if called with the reset argument, and not try to set new ones. Later calls should set the needed new subtitles, and this change avoids some problems with trying to set subtitles when mp_property_sub() in command.c gets called from initialization code before full initialization.
Diffstat (limited to 'mencoder.c')
-rw-r--r--mencoder.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/mencoder.c b/mencoder.c
index d1472a0568..7f4094f663 100644
--- a/mencoder.c
+++ b/mencoder.c
@@ -221,6 +221,12 @@ void mplayer_put_key(struct mp_fifo *fifo, int code)
char *current_module;
#include "mpcommon.h"
+// Needed by mpcommon.c
+void set_osd_subtitle(struct MPContext *mpctx, subtitle *subs) {
+ vo_sub = subs;
+ vo_osd_changed(OSDTYPE_SUBTITLE);
+}
+
//char *out_audio_codec=NULL; // override audio codec
//char *out_video_codec=NULL; // override video codec
@@ -526,14 +532,14 @@ play_next_file:
#ifdef CONFIG_DVDREAD
if(stream->type==STREAMTYPE_DVD){
if(audio_lang && opts.audio_id==-1) opts.audio_id=dvd_aid_from_lang(stream,audio_lang);
- if(dvdsub_lang && opts.sub_id==-2) opts.sub_id=dvd_sid_from_lang(stream,dvdsub_lang);
+ if(dvdsub_lang && opts.sub_id==-1) opts.sub_id=dvd_sid_from_lang(stream,dvdsub_lang);
}
#endif
#ifdef CONFIG_DVDNAV
if(stream->type==STREAMTYPE_DVDNAV){
if(audio_lang && opts.audio_id==-1) opts.audio_id=mp_dvdnav_aid_from_lang(stream,audio_lang);
- if(dvdsub_lang && opts.sub_id==-2) opts.sub_id=mp_dvdnav_sid_from_lang(stream,dvdsub_lang);
+ if(dvdsub_lang && opts.sub_id==-1) opts.sub_id=mp_dvdnav_sid_from_lang(stream,dvdsub_lang);
}
#endif
@@ -553,10 +559,10 @@ if(stream->type==STREAMTYPE_DVDNAV){
select_audio(demuxer, opts.audio_id, audio_lang);
- if (opts.sub_id < 0 && dvdsub_lang)
+ if (opts.sub_id < -1 && dvdsub_lang)
opts.sub_id = demuxer_sub_track_by_lang(demuxer, dvdsub_lang);
- if (opts.sub_id < 0)
+ if (opts.sub_id < -1)
opts.sub_id = demuxer_default_sub_track(demuxer);
for (i = 0; i < MAX_S_STREAMS; i++) {
@@ -1470,7 +1476,7 @@ if(sh_audio && !demuxer2){
}
else
#endif
- update_subtitles(sh_video, d_dvdsub, 0, 0);
+ update_subtitles(NULL, &opts, sh_video, sh_video->pts, 0, d_dvdsub, 0);
frame_data = (s_frame_data){ .start = NULL, .in_size = 0, .frame_time = 0., .already_read = 0 };