summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile6
-rw-r--r--libvo/Makefile2
-rw-r--r--libvo/sub.c3
-rw-r--r--libvo/video_out.c2
-rw-r--r--mencoder.c35
5 files changed, 42 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index dc792ddf7e..2ff8644a2a 100644
--- a/Makefile
+++ b/Makefile
@@ -25,9 +25,9 @@ MANDIR = ${prefix}/man
# 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)
diff --git a/libvo/Makefile b/libvo/Makefile
index bfef5b4492..5c942ed8ec 100644
--- a/libvo/Makefile
+++ b/libvo/Makefile
@@ -3,7 +3,7 @@ include config.mak
LIBNAME = libvo.a
-SRCS=aspect.c aclib.c osd.c font_load.c video_out.c vo_null.c vo_pgm.c vo_md5.c vo_mpegpes.c x11_common.c $(OPTIONAL_SRCS) img_format.c vosub_vidix.c
+SRCS=aspect.c aclib.c osd.c font_load.c video_out.c vo_null.c vo_pgm.c vo_md5.c vo_mpegpes.c x11_common.c $(OPTIONAL_SRCS) img_format.c vosub_vidix.c sub.c
OBJS=$(SRCS:.c=.o)
CFLAGS = $(OPTFLAGS) -I. -I.. $(SDL_INC) $(X11_INC) $(EXTRA_INC) $(DVB_INC) -DMPG12PLAY -DVIDIX_PATH='"$(prefix)/lib/mplayer/vidix/"' #-Wall
diff --git a/libvo/sub.c b/libvo/sub.c
index b0b8c95780..a5ba3b84a1 100644
--- a/libvo/sub.c
+++ b/libvo/sub.c
@@ -1,6 +1,9 @@
+#include "config.h"
+#include "video_out.h"
#include "sub.h"
+#include <stdlib.h>
char * __sub_osd_names[]={
"Seekbar",
diff --git a/libvo/video_out.c b/libvo/video_out.c
index 8edaef83dd..6bbd353e0b 100644
--- a/libvo/video_out.c
+++ b/libvo/video_out.c
@@ -144,5 +144,3 @@ vo_functions_t* video_out_drivers[] =
#endif
NULL
};
-
-#include "sub.c"
diff --git a/mencoder.c b/mencoder.c
index d34819dfa3..b6d2522623 100644
--- a/mencoder.c
+++ b/mencoder.c
@@ -182,6 +182,10 @@ static int cfg_include(struct config *conf, char *filename){
#include "cfg-mplayer-def.h"
#include "cfg-mencoder.h"
+#ifdef USE_DVDREAD
+#include "spudec.h"
+#endif
+
//---------------------------------------------------------------------------
// dummy datas for gui :(
@@ -257,6 +261,19 @@ vo_functions_t video_out;
//---------------------------------------------------------------------------
+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 @@ SwScale_Init();
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 @@ if( (v_pts_corr>=(float)mux_v->h.dwScale/mux_v->h.dwRate && skip_flag<0)
++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 @@ case VCODEC_DIVX4:
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.