summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-15 15:36:07 +0000
committerpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-15 15:36:07 +0000
commitf0446a09ad3e40d1d90071f094acd910f49da3c5 (patch)
treea7ef270aa9fe840b067b7e1fda9d26776c6e00db /mplayer.c
parentc1099888adaf0548fe3b0de86a700576416413b1 (diff)
downloadmpv-f0446a09ad3e40d1d90071f094acd910f49da3c5.tar.bz2
mpv-f0446a09ad3e40d1d90071f094acd910f49da3c5.tar.xz
Add subtitle loader for gui
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3500 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/mplayer.c b/mplayer.c
index 49af12f9ea..ccec73a140 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -589,18 +589,6 @@ if(!parse_codec_cfg(get_path("codecs.conf"))){
}
#endif
-#ifdef USE_SUB
-// check .sub
- if(sub_name){
- int l=strlen(sub_name);
- if ((l>4) && ((0==strcmp(&sub_name[l-4],".utf"))
- ||(0==strcmp(&sub_name[l-4],".UTF"))))
- sub_utf8=1;
- subtitles=sub_read_file(sub_name);
- if(!subtitles || sub_num == 0) mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,sub_name);
- }
-#endif
-
// It's time to init the GUI code: (and fork() the GTK process)
#ifdef HAVE_NEW_GUI
if(use_gui){
@@ -678,6 +666,10 @@ play_next_file:
if(mplShMem->FilenameChanged){
filename=mplShMem->Filename;
}
+#ifdef USE_SUB
+ sub_name=NULL;
+ if ( mplShMem->SubtitleChanged ) sub_name=mplShMem->Subtitlename;
+#endif
}
#endif
@@ -685,6 +677,14 @@ play_next_file:
#ifdef USE_SUB
// check .sub
+ if(sub_name){
+ int l=strlen(sub_name);
+ if ((l>4) && ((0==strcmp(&sub_name[l-4],".utf"))
+ ||(0==strcmp(&sub_name[l-4],".UTF"))))
+ sub_utf8=1;
+ subtitles=sub_read_file(sub_name);
+ if(!subtitles || sub_num == 0) mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,sub_name);
+ }
if(!sub_name){
if(sub_auto && filename) { // auto load sub file ...
subtitles=sub_read_file( sub_filename( get_path("sub/"), filename ) );