summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-20 18:36:50 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-20 18:36:50 +0000
commit7cb47d1cbc5b63c0c17b67a408a3eaabee2b38d9 (patch)
tree14bd177d8fa1f2134ecd518bbf4a6fa6f51fa5ba /mplayer.c
parent8d04f52cd7753af44c05c87759b12aff672f19aa (diff)
downloadmpv-7cb47d1cbc5b63c0c17b67a408a3eaabee2b38d9.tar.bz2
mpv-7cb47d1cbc5b63c0c17b67a408a3eaabee2b38d9.tar.xz
DVD sub patch by Kim Minh Kaplan <kmkaplan@selfoffice.com>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3035 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/mplayer.c b/mplayer.c
index 7984e5a08f..00151e74da 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -249,11 +249,17 @@ static unsigned int inited_flags=0;
#define INITED_GUI 4
#define INITED_GETCH2 8
#define INITED_LIRC 16
+#define INITED_SPUDEC 32
#define INITED_STREAM 64
#define INITED_ALL 0xFFFF
void uninit_player(unsigned int mask){
mask=inited_flags&mask;
+ if (mask&INITED_SPUDEC){
+ inited_flags&=~INITED_SPUDEC;
+ current_module="uninit_spudec";
+ spudec_free(vo_spudec);
+ }
if(mask&INITED_VO){
inited_flags&=~INITED_VO;
current_module="uninit_vo";
@@ -753,6 +759,11 @@ play_next_file:
}
/*DSP!! if(dsp) audio_out->control(AOCONTROL_SET_DEVICE,(int)dsp);*/
+ current_module="spudec";
+ vo_spudec=spudec_new();
+ if (vo_spudec!=NULL)
+ inited_flags|=INITED_SPUDEC;
+ current_module=NULL;
current_module="open_stream";
stream=open_stream(filename,vcd_track,&file_format);
@@ -1986,19 +1997,21 @@ if(rel_seek_secs || abs_seek_pos){
#endif
// DVD sub:
- { unsigned char* packet=NULL;
+ if(vo_spudec){
+ unsigned char* packet=NULL;
int len=ds_get_packet_sub(d_dvdsub,&packet);
+ current_module="spudec";
if(len>=2){
int len2;
len2=(packet[0]<<8)+packet[1];
mp_msg(MSGT_CPLAYER,MSGL_V,"\rDVD sub: %d / %d \n",len,len2);
- if(len==len2)
- spudec_decode(packet,len);
- else
- mp_msg(MSGT_CPLAYER,MSGL_V,"fragmented dvd-subs not yet supported!!!\n");
- } else if(len>=0) {
- mp_msg(MSGT_CPLAYER,MSGL_V,"invalid dvd sub\n");
+ spudec_assemble(vo_spudec,packet,len,100*d_video->pts);
+ } else {
+ spudec_heartbeat(vo_spudec,100*d_video->pts);
+ if(len>=0)
+ mp_msg(MSGT_CPLAYER,MSGL_V,"invalid dvd sub\n");
}
+ current_module=NULL;
}
} // while(!eof)