[Mplayer-cvslog] CVS: main Makefile,1.137,1.138 mencoder.c,1.55,1.56

Kim Minh Kaplan CVS kmkaplan at mplayer.dev.hu
Fri Jan 11 17:06:47 CET 2002


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv2106

Modified Files:
	Makefile mencoder.c 
Log Message:
Add DVD subtitles to menoder

Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/Makefile,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -r1.137 -r1.138
--- Makefile	10 Jan 2002 17:14:55 -0000	1.137
+++ Makefile	11 Jan 2002 16:06:44 -0000	1.138
@@ -25,9 +25,9 @@
 # a BSD compatible 'install' program
 INSTALL = install
 
-SRCS_COMMON = cyuv.c adpcm.c xacodec.c cpudetect.c mp_msg.c ac3-iec958.c dec_audio.c dec_video.c msvidc.c cinepak.c fli.c qtrle.c codec-cfg.c cfgparser.c my_profile.c RTjpegN.c minilzo.c nuppelvideo.c
-SRCS_MENCODER = mencoder.c $(SRCS_COMMON) libao2/afmt.c divx4_vbr.c libvo/aclib.c libvo/img_format.c
-SRCS_MPLAYER = mplayer.c $(SRCS_COMMON) find_sub.c subreader.c lirc_mp.c mixer.c spudec.c playtree.c playtreeparser.c asxparser.c vobsub.c
+SRCS_COMMON = cyuv.c adpcm.c xacodec.c cpudetect.c mp_msg.c ac3-iec958.c dec_audio.c dec_video.c msvidc.c cinepak.c fli.c qtrle.c codec-cfg.c cfgparser.c my_profile.c RTjpegN.c minilzo.c nuppelvideo.c spudec.c
+SRCS_MENCODER = mencoder.c $(SRCS_COMMON) libao2/afmt.c divx4_vbr.c libvo/aclib.c libvo/img_format.c libvo/osd.c
+SRCS_MPLAYER = mplayer.c $(SRCS_COMMON) find_sub.c subreader.c lirc_mp.c mixer.c playtree.c playtreeparser.c asxparser.c vobsub.c
 
 OBJS_MENCODER = $(SRCS_MENCODER:.c=.o)
 OBJS_MPLAYER = $(SRCS_MPLAYER:.c=.o)

Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- mencoder.c	4 Jan 2002 14:03:02 -0000	1.55
+++ mencoder.c	11 Jan 2002 16:06:44 -0000	1.56
@@ -182,6 +182,10 @@
 #include "cfg-mplayer-def.h"
 #include "cfg-mencoder.h"
 
+#ifdef USE_DVDREAD
+#include "spudec.h"
+#endif
+
 //---------------------------------------------------------------------------
 
 // dummy datas for gui :(
@@ -257,6 +261,19 @@
 
 //---------------------------------------------------------------------------
 
+void *vo_spudec=NULL;
+
+static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
+    vo_draw_alpha_yv12(w,h,src,srca,stride,vo_image + vo_w * y0 + x0,vo_w);
+}
+
+static void draw_sub(void) {
+#ifdef USE_DVDREAD
+    if (vo_spudec)
+	spudec_draw_scaled(vo_spudec, vo_w, vo_h, draw_alpha);
+#endif
+}
+
 int dec_audio(sh_audio_t *sh_audio,unsigned char* buffer,int total){
     int size=0;
     int eof=0;
@@ -560,6 +577,11 @@
 video_out.draw_slice=draw_slice;
 video_out.draw_frame=draw_frame;
 
+#ifdef USE_DVDREAD
+vo_spudec=spudec_new_scaled(stream->priv?((dvd_priv_t *)(stream->priv))->cur_pgc->palette:NULL,
+			    sh_video->disp_w, sh_video->disp_h);
+#endif
+
 // set up output file:
 muxer_f=fopen(out_filename,"wb");
 if(!muxer_f) {
@@ -1118,6 +1140,18 @@
     ++skip_flag; // skip
   }
 
+#ifdef USE_DVDREAD
+// DVD sub:
+ if(vo_spudec){
+     unsigned char* packet=NULL;
+     int len;
+     while((len=ds_get_packet_sub(d_dvdsub,&packet))>0){
+	 mp_msg(MSGT_MENCODER,MSGL_V,"\rDVD sub: len=%d  v_pts=%5.3f  s_pts=%5.3f  \n",len,d_video->pts,d_dvdsub->pts);
+	 spudec_assemble(vo_spudec,packet,len,100*d_dvdsub->pts);
+     }
+     spudec_heartbeat(vo_spudec,100*d_video->pts);
+ }
+#endif
 
 switch(mux_v->codec){
 case VCODEC_COPY:
@@ -1145,6 +1179,7 @@
     return 0; /* FIXME */
 #else
     blit_frame=decode_video(&video_out,sh_video,start,in_size,0);
+    draw_sub();
     if(skip_flag>0) break;
     if(!blit_frame){
 	// empty.




More information about the MPlayer-cvslog mailing list