summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authoratmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-20 22:41:06 +0000
committeratmos4 <atmos4@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-20 22:41:06 +0000
commit64f3eca29d0fcc690615b40c751bb3c69dccc7c2 (patch)
tree1bbef1ee4558d773b99a2ce8970e8085d6318b88 /mplayer.c
parent78bc50b036daafbbc36a507faecdb6bffd88327f (diff)
downloadmpv-64f3eca29d0fcc690615b40c751bb3c69dccc7c2.tar.bz2
mpv-64f3eca29d0fcc690615b40c751bb3c69dccc7c2.tar.xz
autodetect vobsub filename, disable autosub if vobsub found.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4771 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/mplayer.c b/mplayer.c
index f0056de7df..ca13bbd92c 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -764,6 +764,22 @@ play_dvd:
if(filename) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_Playing, filename);
+ current_module="vobsub";
+ if (vobsub_name){
+ vo_vobsub=vobsub_open(vobsub_name);
+ if(vo_vobsub==NULL)
+ mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,vobsub_name);
+ }else if(sub_auto && filename && (strlen(filename)>=5)){
+ /* try to autodetect vobsub from movie filename ::atmos */
+ char *buf = malloc((strlen(filename)-3) * sizeof(char));
+ memset(buf,0,strlen(filename)-3); // make sure string is terminated
+ strncpy(buf, filename, strlen(filename)-4);
+ vo_vobsub=vobsub_open(buf);
+ free(buf);
+ }
+ if(vo_vobsub)
+ sub_auto=0; // don't do autosub for textsubs if vobsub found
+
#ifdef USE_SUB_OLD
// check .sub
if(sub_name){
@@ -789,13 +805,6 @@ play_dvd:
if(subtitles && stream_dump_type==4) dump_mpsub(subtitles, fps);
#endif
- current_module="vobsub";
- if (vobsub_name){
- vo_vobsub=vobsub_open(vobsub_name);
- if(vo_vobsub==NULL)
- mp_msg(MSGT_CPLAYER,MSGL_ERR,MSGTR_CantLoadSub,vobsub_name);
- }
-
stream=NULL;
demuxer=NULL;
d_audio=NULL;