From 1e38367065037a0a2899dbd9b1708eefed4e84a7 Mon Sep 17 00:00:00 2001 From: kmkaplan Date: Thu, 10 Jan 2002 17:18:30 +0000 Subject: Add vobsub support. Update spudec with spudec_new new usage. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4080 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mplayer.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/mplayer.c b/mplayer.c index 80e0b27e9e..70886b213d 100644 --- a/mplayer.c +++ b/mplayer.c @@ -56,6 +56,7 @@ extern void* mDisplay; // Display* mDisplay; #ifdef USE_DVDREAD #include "spudec.h" #endif +#include "vobsub.h" #include "linux/getch2.h" #include "linux/keycodes.h" @@ -195,6 +196,7 @@ int allow_dshow=0; int audio_id=-1; int video_id=-1; int dvdsub_id=-1; +int vobsub_id=-1; char* audio_lang=NULL; char* dvdsub_lang=NULL; static int vcd_track=0; @@ -246,6 +248,7 @@ char *sub_name=NULL; float sub_delay=0; float sub_fps=0; int sub_auto = 1; +char *vobsub_name=NULL; /*DSP!!char *dsp=NULL;*/ extern char *vo_subdevice; @@ -753,6 +756,13 @@ 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; @@ -896,7 +906,7 @@ if(stream_dump_type==5){ if(dvdsub_lang && dvdsub_id==-1) dvdsub_id=dvd_sid_from_lang(stream,dvdsub_lang); current_module="spudec"; - vo_spudec=spudec_new(stream->priv); + vo_spudec=spudec_new(stream->priv?((dvd_priv_t *)(stream->priv))->cur_pgc->palette:NULL); if (vo_spudec!=NULL) inited_flags|=INITED_SPUDEC; #endif @@ -2177,6 +2187,9 @@ if(rel_seek_secs || abs_seek_pos){ current_module="seek"; if(demux_seek(demuxer,rel_seek_secs,abs_seek_pos)){ // success: + /* FIXME there should be real seeking for vobsub */ + if (vo_vobsub) + vobsub_reset(vo_vobsub); if(sh_audio){ if(verbose){ @@ -2301,6 +2314,13 @@ if(rel_seek_secs || abs_seek_pos){ #endif + // VobSub subtitles + if(vo_vobsub){ + current_module="vobsub"; + vobsub_process(vo_vobsub,d_video->pts); + current_module=NULL; + } + #ifdef USE_DVDREAD // DVD sub: if(vo_spudec){ -- cgit v1.2.3