diff options
author | 2002-08-12 16:00:35 +0000 | |
---|---|---|
committer | 2002-08-12 16:00:35 +0000 | |
commit | 67e4de4028c9a6f3b908e7e1b9627bd9c97803de (patch) | |
tree | 49632dbc925d1d95639a84ec871fe7f1627798a3 /media-video | |
parent | mask latest mplayer (diff) | |
download | historical-67e4de4028c9a6f3b908e7e1b9627bd9c97803de.tar.gz historical-67e4de4028c9a6f3b908e7e1b9627bd9c97803de.tar.bz2 historical-67e4de4028c9a6f3b908e7e1b9627bd9c97803de.zip |
this version should work with libdvdnav-0.1.3
Diffstat (limited to 'media-video')
-rw-r--r-- | media-video/mplayer/ChangeLog | 8 | ||||
-rw-r--r-- | media-video/mplayer/files/digest-mplayer-0.90_pre6-r3 | 3 | ||||
-rw-r--r-- | media-video/mplayer/files/mplayer-0.90_pre6-libdvdnav-0.1.3.patch | 457 | ||||
-rw-r--r-- | media-video/mplayer/mplayer-0.90_pre6-r3.ebuild | 286 |
4 files changed, 753 insertions, 1 deletions
diff --git a/media-video/mplayer/ChangeLog b/media-video/mplayer/ChangeLog index 4df1bc8fa50a..40f493b4c55a 100644 --- a/media-video/mplayer/ChangeLog +++ b/media-video/mplayer/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for media-video/mplayer # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL -# $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/ChangeLog,v 1.26 2002/08/07 20:34:32 azarah Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/ChangeLog,v 1.27 2002/08/12 16:00:35 azarah Exp $ + +*mplayer-0.90_pre6-r3 (12 Aug 2002) + + 12 Aug 2002; Martin Schlemmer <azarah@gentoo.org> mplayer-0.90_pre6-r3 : + + Add patch to support libdvdnav-0.1.3. *mplayer-0.90_pre6-r2 (07 Aug 2002) diff --git a/media-video/mplayer/files/digest-mplayer-0.90_pre6-r3 b/media-video/mplayer/files/digest-mplayer-0.90_pre6-r3 new file mode 100644 index 000000000000..9358dd6ed906 --- /dev/null +++ b/media-video/mplayer/files/digest-mplayer-0.90_pre6-r3 @@ -0,0 +1,3 @@ +MD5 819b4db6133291886df34cadcc03e09d MPlayer-0.90pre6.tar.bz2 2599258 +MD5 ab23f8e01a860a97852b28a3b0b118da mp-arial-iso-8859-1.zip 272659 +MD5 5e12e283eeeec6125523a6f4a60d07cf default-skin-0.1.tar.bz2 167697 diff --git a/media-video/mplayer/files/mplayer-0.90_pre6-libdvdnav-0.1.3.patch b/media-video/mplayer/files/mplayer-0.90_pre6-libdvdnav-0.1.3.patch new file mode 100644 index 000000000000..9c02a3619f7a --- /dev/null +++ b/media-video/mplayer/files/mplayer-0.90_pre6-libdvdnav-0.1.3.patch @@ -0,0 +1,457 @@ +diff -urN MPlayer-0.90pre6/Makefile MPlayer-20020812/Makefile +--- MPlayer-0.90pre6/Makefile Thu Jul 25 05:37:27 2002 ++++ MPlayer-20020812/Makefile Sat Aug 10 20:45:31 2002 +@@ -280,6 +280,9 @@ + -rm -f *.o *.a .depend configure.log + @for a in $(PARTS); do $(MAKE) -C $$a distclean; done + ++strip: ++ strip -s $(ALL_PRG) ++ + dep: depend + + depend: +@@ -287,6 +290,15 @@ + $(CC) -MM $(CFLAGS) mplayer.c mencoder.c $(SRCS_MPLAYER) $(SRCS_MENCODER) 1>.depend + @for a in $(PARTS); do $(MAKE) -C $$a dep; done + ++# ./configure must be run if it changed in CVS ++config.h: configure ++ @echo "############################################################" ++ @echo "####### Please run ./configure again - it's changed! #######" ++ @echo "############################################################" ++ifeq ($(wildcard .developer),) ++ @exit 1 ++endif ++ + # do not rebuild after cvs commits if .developer file is present! + + # rebuild at every config.h/config.mak change: +diff -urN MPlayer-0.90pre6/configure MPlayer-20020812/configure +--- MPlayer-0.90pre6/configure Mon Aug 5 19:23:22 2002 ++++ MPlayer-20020812/configure Sun Aug 11 19:14:41 2002 +@@ -3083,6 +3101,10 @@ + else + _ld_css="$_ld_css -ldvdnav" + fi ++ if test -n "$_dvdnavconfig" ; then ++ _dvdnav_version=`$_dvdnavconfig --version | sed "s/\.//g"` ++ _def_dvdnav_version="#define DVDNAVVERSION $_dvdnav_version" ++ fi + if test -n "$_dvdnavdir" ; then + _inc_extra="$_inc_extra -I$_dvdnavdir" + fi +@@ -4382,6 +4416,7 @@ + + /* DVD navigation support using libdvdnav */ + $_def_dvdnav ++$_def_dvdnav_version + + /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */ + #define MPEG12_POSTPROC 1 +diff -urN MPlayer-0.90pre6/libmpcodecs/native/msvidc.c MPlayer-20020812/libmpcodecs/native/msvidc.c +--- MPlayer-0.90pre6/libmpcodecs/native/msvidc.c Sun Jan 13 08:01:04 2002 ++++ MPlayer-20020812/libmpcodecs/native/msvidc.c Fri Aug 9 23:30:20 2002 +@@ -11,6 +11,7 @@ + + #include "config.h" + #include "bswap.h" ++#define quad quad_m + + #define LE_16(x) (le2me_16(*(unsigned short *)(x))) + +diff -urN MPlayer-0.90pre6/libmpcodecs/ve_lavc.c MPlayer-20020812/libmpcodecs/ve_lavc.c +--- MPlayer-0.90pre6/libmpcodecs/ve_lavc.c Mon Jul 8 23:34:24 2002 ++++ MPlayer-20020812/libmpcodecs/ve_lavc.c Wed Aug 7 02:08:57 2002 +@@ -67,6 +67,7 @@ + static int lavc_param_strict= 0; + static int lavc_param_data_partitioning= 0; + static int lavc_param_gray=0; ++static int lavc_param_mpeg_quant=0; + + #include "cfgparser.h" + +@@ -101,6 +102,9 @@ + #if LIBAVCODEC_BUILD >= 4614 + {"gray", &lavc_param_gray, CONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART, NULL}, + #endif ++#if LIBAVCODEC_BUILD >= 4619 ++ {"mpeg_quant", &lavc_param_mpeg_quant, CONF_TYPE_FLAG, 0, 0, 1, NULL}, ++#endif + {NULL, NULL, 0, 0, 0, 0, NULL} + }; + #endif +@@ -156,7 +160,10 @@ + if(lavc_param_packet_size )lavc_venc_context.rtp_mode=1; + lavc_venc_context.strict_std_compliance= lavc_param_strict; + #endif +- ++#if LIBAVCODEC_BUILD >= 4619 ++ lavc_venc_context.mpeg_quant=lavc_param_mpeg_quant; ++#endif ++ + /* keyframe interval */ + if (lavc_param_keyint >= 0) /* != -1 */ + lavc_venc_context.gop_size = lavc_param_keyint; +diff -urN MPlayer-0.90pre6/libmpcodecs/vf_noise.c MPlayer-20020812/libmpcodecs/vf_noise.c +--- MPlayer-0.90pre6/libmpcodecs/vf_noise.c Sun Jun 16 15:54:36 2002 ++++ MPlayer-20020812/libmpcodecs/vf_noise.c Sun Aug 11 12:52:22 2002 +@@ -42,15 +42,20 @@ + //===========================================================================// + + static inline void lineNoise_C(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift); ++static inline void lineNoiseAvg_C(uint8_t *dst, uint8_t *src, int len, int8_t **shift); + + static void (*lineNoise)(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift)= lineNoise_C; ++static void (*lineNoiseAvg)(uint8_t *dst, uint8_t *src, int len, int8_t **shift)= lineNoiseAvg_C; + + typedef struct FilterParam{ + int strength; + int uniform; + int temporal; + int quality; ++ int averaged; ++ int shiftptr; + int8_t *noise; ++ int8_t *prev_shift[MAX_RES][3]; + }FilterParam; + + struct vf_priv_s { +@@ -65,17 +70,21 @@ + static int8_t *initNoise(FilterParam *fp){ + int strength= fp->strength; + int uniform= fp->uniform; ++ int averaged= fp->averaged; + int8_t *noise= memalign(16, MAX_NOISE*sizeof(int8_t)); +- int i; ++ int i, j; + + srand(123457); + + for(i=0; i<MAX_NOISE; i++) + { +- if(uniform) +- noise[i]= ((rand()/11)%strength) - strength/2; +- else +- { ++ if(uniform) { ++ if (averaged) { ++ noise[i]= (((rand()/11)%strength) - strength/2)/3; ++ } else { ++ noise[i]= ((rand()/11)%strength) - strength/2; ++ } ++ } else { + double x1, x2, w, y1; + do { + x1 = 2.0 * rand()/(float)RAND_MAX - 1.0; +@@ -86,12 +95,18 @@ + w = sqrt( (-2.0 * log( w ) ) / w ); + y1= x1 * w; + +- y1*= strength / sqrt(3.0); ++ y1*= strength / sqrt(3.0); + if (y1<-128) y1=-128; + else if(y1> 127) y1= 127; ++ if (averaged) y1 /= 3.0; + noise[i]= (int)y1; + } + } ++ ++ ++ for (i = 0; i < MAX_RES; i++) ++ for (j = 0; j < 3; j++) ++ fp->prev_shift[i][j] = noise + (rand()&(MAX_SHIFT-1)); + + if(nonTempRandShift[0]==-1){ + for(i=0; i<MAX_RES; i++){ +@@ -100,9 +115,12 @@ + } + + fp->noise= noise; ++ fp->shiftptr= 0; + return noise; + } + ++/***************************************************************************/ ++ + #ifdef HAVE_MMX + static inline void lineNoise_MMX(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){ + int mmx_len= len&(~7); +@@ -172,6 +190,63 @@ + } + } + ++/***************************************************************************/ ++ ++#ifdef HAVE_MMX ++static inline void lineNoiseAvg_MMX(uint8_t *dst, uint8_t *src, int len, int8_t **shift){ ++ int mmx_len= len&(~7); ++ ++ asm volatile( ++ "movl %5, %%eax \n\t" ++ ".balign 16 \n\t" ++ "1: \n\t" ++ "movq (%1, %%eax), %%mm1 \n\t" ++ "movq (%0, %%eax), %%mm0 \n\t" ++ "paddb (%2, %%eax), %%mm1 \n\t" ++ "paddb (%3, %%eax), %%mm1 \n\t" ++ "movq %%mm0, %%mm2 \n\t" ++ "movq %%mm1, %%mm3 \n\t" ++ "punpcklbw %%mm0, %%mm0 \n\t" ++ "punpckhbw %%mm2, %%mm2 \n\t" ++ "punpcklbw %%mm1, %%mm1 \n\t" ++ "punpckhbw %%mm3, %%mm3 \n\t" ++ "pmulhw %%mm0, %%mm1 \n\t" ++ "pmulhw %%mm2, %%mm3 \n\t" ++ "paddw %%mm1, %%mm1 \n\t" ++ "paddw %%mm3, %%mm3 \n\t" ++ "paddw %%mm0, %%mm1 \n\t" ++ "paddw %%mm2, %%mm3 \n\t" ++ "psrlw $8, %%mm1 \n\t" ++ "psrlw $8, %%mm3 \n\t" ++ "packuswb %%mm3, %%mm1 \n\t" ++ "movq %%mm1, (%4, %%eax) \n\t" ++ "addl $8, %%eax \n\t" ++ " js 1b \n\t" ++ :: "r" (src+mmx_len), "r" (shift[0]+mmx_len), "r" (shift[1]+mmx_len), "r" (shift[2]+mmx_len), ++ "r" (dst+mmx_len), "g" (-mmx_len) ++ : "%eax" ++ ); ++ ++ if(mmx_len!=len){ ++ int8_t *shift2[3]={shift[0]+mmx_len, shift[1]+mmx_len, shift[2]+mmx_len}; ++ lineNoiseAvg_C(dst+mmx_len, src+mmx_len, len-mmx_len, shift2); ++ } ++} ++#endif ++ ++static inline void lineNoiseAvg_C(uint8_t *dst, uint8_t *src, int len, int8_t **shift){ ++ int i; ++ int8_t *src2= (int8_t*)src; ++ ++ for(i=0; i<len; i++) ++ { ++ const int n= shift[0][i] + shift[1][i] + shift[2][i]; ++ dst[i]= src2[i]+((n*src2[i])>>7); ++ } ++} ++ ++/***************************************************************************/ ++ + static void noise(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int width, int height, FilterParam *fp){ + int8_t *noise= fp->noise; + int y; +@@ -200,10 +275,17 @@ + else shift= nonTempRandShift[y]; + + if(fp->quality==0) shift&= ~7; +- lineNoise(dst, src, noise, width, shift); ++ if (fp->averaged) { ++ lineNoiseAvg(dst, src, width, fp->prev_shift[y]); ++ fp->prev_shift[y][fp->shiftptr] = noise + shift; ++ } else { ++ lineNoise(dst, src, noise, width, shift); ++ } + dst+= dstStride; + src+= srcStride; + } ++ fp->shiftptr++; ++ if (fp->shiftptr == 3) fp->shiftptr = 0; + } + + static int config(struct vf_instance_s* vf, +@@ -215,8 +297,7 @@ + + static void get_image(struct vf_instance_s* vf, mp_image_t *mpi){ + if(mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change +- if(!(mpi->flags&MP_IMGFLAG_ACCEPT_STRIDE) && mpi->imgfmt!=vf->priv->outfmt) +- return; // colorspace differ ++ if(mpi->imgfmt!=vf->priv->outfmt) return; // colorspace differ + // ok, we can do pp in-place (or pp disabled): + vf->priv->dmpi=vf_get_image(vf->next,mpi->imgfmt, + mpi->type, mpi->flags, mpi->w, mpi->h); +@@ -301,6 +382,11 @@ + if(pos && pos<max) fp->temporal=1; + pos= strchr(args, 'h'); + if(pos && pos<max) fp->quality=1; ++ pos= strchr(args, 'a'); ++ if(pos && pos<max) { ++ fp->temporal=1; ++ fp->averaged=1; ++ } + + if(fp->strength) initNoise(fp); + } +@@ -337,10 +423,14 @@ + + + #ifdef HAVE_MMX +- if(gCpuCaps.hasMMX) lineNoise= lineNoise_MMX; ++ if(gCpuCaps.hasMMX){ ++ lineNoise= lineNoise_MMX; ++ lineNoiseAvg= lineNoiseAvg_MMX; ++ } + #endif + #ifdef HAVE_MMX2 + if(gCpuCaps.hasMMX2) lineNoise= lineNoise_MMX2; ++// if(gCpuCaps.hasMMX) lineNoiseAvg= lineNoiseAvg_MMX2; + #endif + + return 1; +diff -urN MPlayer-0.90pre6/libmpdemux/demux_real.c MPlayer-20020812/libmpdemux/demux_real.c +--- MPlayer-0.90pre6/libmpdemux/demux_real.c Mon Aug 5 05:13:45 2002 ++++ MPlayer-20020812/libmpdemux/demux_real.c Mon Aug 12 02:04:37 2002 +@@ -8,6 +8,9 @@ + TODO: fix the whole syncing mechanism + + $Log: not supported by cvs2svn $ ++ Revision 1.20 2002/08/12 00:04:37 arpi ++ RV40 support ++ + Revision 1.19 2002/08/05 03:13:45 arpi + fixed 'eof at 66s' bug + +@@ -518,7 +521,8 @@ + ds_add_packet(ds, dp); + } else + if (sh_video != NULL) { +- if (sh_video->format==0x30335652 || ++ if (sh_video->format==0x30345652 || ++ sh_video->format==0x30335652 || + sh_video->format==0x30325652 ) { + // we need a more complicated demuxing + // a block may contain multiple packets +@@ -1065,6 +1069,9 @@ + case 0x30202002: + /* codec id: rv30 */ + break; ++ case 0x40000000: ++ /* codec id: rv40 */ ++ break; + default: + /* codec id: none */ + mp_msg(MSGT_DEMUX,MSGL_V,"unknown id: %x\n", tmp); +diff -urN MPlayer-0.90pre6/mplayer.c MPlayer-20020812/mplayer.c +--- MPlayer-0.90pre6/mplayer.c Mon Aug 5 20:37:14 2002 ++++ MPlayer-20020812/mplayer.c Sun Aug 11 19:14:41 2002 +@@ -1468,7 +1468,7 @@ + + if(play_n_frames>=0){ + --play_n_frames; +- if(play_n_frames<=0) eof = PT_NEXT_ENTRY; ++ if(play_n_frames<0) eof = PT_NEXT_ENTRY; + } + + /*========================== PLAY AUDIO ============================*/ +@@ -2390,9 +2390,9 @@ + } + #endif + } break; +- case MP_CMD_MUTE: { +- mixer_mute(); +- } ++ case MP_CMD_MUTE: ++ mixer_mute(); ++ break; + case MP_CMD_LOADFILE : { + play_tree_t* e = play_tree_new(); + play_tree_add_file(e,cmd->args[0].v.s); +@@ -2692,7 +2692,24 @@ + break; + } + case DVDNAV_SPU_STREAM_CHANGE: { +- dvdnav_stream_change_event_t * stream_change=(dvdnav_stream_change_event_t*)(dvdnav_event->details); ++#if DVDNAVVERSION > 012 ++ dvdnav_spu_stream_change_event_t *stream_change = (dvdnav_spu_stream_change_event_t*)(dvdnav_event->details); ++ ++ printf("DVDNAV Event: Nav SPU Stream Change: phys: %d/%d/%d logical: %d\n", ++ stream_change->physical_wide, ++ stream_change->physical_letterbox, ++ stream_change->physical_pan_scan, ++ stream_change->logical); ++ ++ if (vo_spudec && dvdsub_id!=stream_change->physical_wide) { ++ mp_msg(MSGT_INPUT,MSGL_DBG2,"d_dvdsub->id change: was %d is now %d\n", ++ d_dvdsub->id,stream_change->physical_wide); ++ // FIXME: need a better way to change SPU id ++ d_dvdsub->id=dvdsub_id=stream_change->physical_wide; ++ if (vo_spudec) spudec_reset(vo_spudec); ++ } ++#else ++ dvdnav_stream_change_event_t *stream_change = (dvdnav_stream_change_event_t*)(dvdnav_event->details); + + printf("DVDNAV Event: Nav SPU Stream Change: phys: %d logical: %d\n", + stream_change->physical, +@@ -2705,12 +2722,16 @@ + d_dvdsub->id=dvdsub_id=stream_change->physical; + if (vo_spudec) spudec_reset(vo_spudec); + } +- ++#endif + break; + } + case DVDNAV_AUDIO_STREAM_CHANGE: { + int aid_temp; ++#if DVDNAVVERSION > 012 ++ dvdnav_audio_stream_change_event_t *stream_change = (dvdnav_audio_stream_change_event_t*)(dvdnav_event->details); ++#else + dvdnav_stream_change_event_t *stream_change = (dvdnav_stream_change_event_t*)(dvdnav_event->details); ++#endif + + printf("DVDNAV Event: Nav Audio Stream Change: phys: %d logical: %d\n", + stream_change->physical, +diff -urN MPlayer-0.90pre6/postproc/postprocess_template.c MPlayer-20020812/postproc/postprocess_template.c +--- MPlayer-0.90pre6/postproc/postprocess_template.c Sun May 5 13:08:59 2002 ++++ MPlayer-20020812/postproc/postprocess_template.c Thu Aug 8 12:46:16 2002 +@@ -122,7 +122,7 @@ + "movd %%mm0, %0 \n\t" + : "=r" (numEq) + : "r" (src), "r" (stride) +- : "%ebx" ++ : "%eax", "%ebx" + ); + numEq= (-numEq) &0xFF; + +diff -urN MPlayer-0.90pre6/spudec.c MPlayer-20020812/spudec.c +--- MPlayer-0.90pre6/spudec.c Wed Jul 24 18:47:29 2002 ++++ MPlayer-20020812/spudec.c Tue Aug 6 15:32:55 2002 +@@ -927,25 +927,7 @@ + + void *spudec_new_scaled(unsigned int *palette, unsigned int frame_width, unsigned int frame_height) + { +- spudec_handle_t *this = calloc(1, sizeof(spudec_handle_t)); +- if (this) { +- if (palette) { +- memcpy(this->global_palette, palette, sizeof(this->global_palette)); +- this->auto_palette = 0; +- } +- else { +- /* No palette, compute one */ +- this->auto_palette = 1; +- } +- this->packet = NULL; +- this->image = NULL; +- this->scaled_image = NULL; +- this->orig_frame_width = frame_width; +- this->orig_frame_height = frame_height; +- } +- else +- mp_msg(MSGT_SPUDEC,MSGL_FATAL, "FATAL: spudec_init: calloc"); +- return this; ++ return spudec_new_scaled_vobsub(palette, NULL, 0, frame_width, frame_height); + } + + /* get palette custom color, width, height from .idx file */ +@@ -957,8 +939,10 @@ + this->packet = NULL; + this->image = NULL; + this->scaled_image = NULL; +- this->orig_frame_width = frame_width; +- this->orig_frame_height = frame_height; ++ /* XXX Although the video frame is some size, the SPU frame is ++ always maximum size i.e. 720 wide and 576 or 480 high */ ++ this->orig_frame_width = 720; ++ this->orig_frame_height = (frame_height == 480 || frame_height == 240) ? 480 : 576; + this->custom = custom; + // set up palette: + this->auto_palette = 1; diff --git a/media-video/mplayer/mplayer-0.90_pre6-r3.ebuild b/media-video/mplayer/mplayer-0.90_pre6-r3.ebuild new file mode 100644 index 000000000000..b95907ce10e6 --- /dev/null +++ b/media-video/mplayer/mplayer-0.90_pre6-r3.ebuild @@ -0,0 +1,286 @@ +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/mplayer-0.90_pre6-r3.ebuild,v 1.1 2002/08/12 16:00:35 azarah Exp $ + +# NOTE to myself: Test this thing with and without dvd/gtk+ support, +# as it seems the mplayer guys dont really care to +# make it work without dvd support. + +# Handle PREversions as well +MY_PV=${PV/_/} +S="${WORKDIR}/MPlayer-${MY_PV}" +# Only install Skin if GUI should be build (gtk as USE flag) +SRC_URI="ftp://mplayerhq.hu/MPlayer/releases/MPlayer-${MY_PV}.tar.bz2 + ftp://mplayerhq.hu/MPlayer/releases/mp-arial-iso-8859-1.zip + gtk? ( http://www.ibiblio.org/gentoo/distfiles/default-skin-0.1.tar.bz2 )" +# This is to get the digest problem fixed. +# gtk? ( ftp://mplayerhq.hu/MPlayer/Skin/default.tar.bz2 )" +DESCRIPTION="Media Player for Linux" +HOMEPAGE="http://www.mplayerhq.hu/" + +# 'encode' in USE for MEncoder. +# If 'dvd' in USE, only DEPEND on libdvdnav, as +# we use libdvdkit that comes with. +RDEPEND=">=media-libs/divx4linux-20020418 + >=media-libs/win32codecs-0.60 + dvd? ( media-libs/libdvdnav ) + gtk? ( =x11-libs/gtk+-1.2* + media-libs/libpng ) + esd? ( media-sound/esound ) + ggi? ( media-libs/libggi ) + sdl? ( media-libs/libsdl ) + alsa? ( media-libs/alsa-lib ) + svga? ( media-libs/svgalib ) + encode? ( media-sound/lame + >=media-libs/libdv-0.9.5 ) + opengl? ( virtual/opengl ) + directfb? ( dev-libs/DirectFB ) + oggvorbis? ( media-libs/libvorbis ) + >=sys-apps/portage-1.9.10" + +DEPEND="${RDEPEND} + dev-lang/nasm + app-arch/unzip" + +SLOT="0" +LICENSE="GPL" +KEYWORDS="x86" + + +src_unpack() { + + unpack MPlayer-${MY_PV}.tar.bz2 mp-arial-iso-8859-1.zip + + # Fix bug with the default Skin + use gtk && ( \ + unpack default-skin-0.1.tar.bz2 + cd ${WORKDIR}/default + patch < ${FILESDIR}/default-skin.diff || die "gtk patch failed" + ) + + cd ${S} + # Patch to enable use of libdvdnav-0.1.3 + # Azarah (12 Aug 2002) + patch -p1 < ${FILESDIR}/${P}-libdvdnav-0.1.3.patch || die + # Fixes some compile problems, thanks to Gwenn Gueguen + patch -p0 < ${FILESDIR}/mplayer-0.90_pre5-widget.patch || die + # Fixes include problem - Azarah (10 Jun 2002) + # Update for pre6 - Azarah (07 Aug 2002) + patch -p1 < ${FILESDIR}/${P}-stream-include.patch || die + # Fixes install location for vidix drivers, thanks to Mezei Zoltan. + patch -p1 < ${FILESDIR}/mplayer-0.90_pre5-vidix-destpath.patch || die + # Fix missing subtitles for some regions (4), bug #3679, thanks + # to Bernardo Silva + patch -p1 < ${FILESDIR}/mplayer-0.90_pre5-spudec.c.patch || die + # Fixes intermittant problems where vidix drivers do not get build, + # and causes the install to fail - Azarah (06 Aug 2002) + patch -p1 < ${FILESDIR}/${P}-vidix-fail-install.patch || die + # Fixes compile problems if dvd support not enabled. + # Azarah (07 Aug 2002) + patch -p1 < ${FILESDIR}/${P}-no-dvd.patch || die +} + +src_compile() { + + if use matrox; then + check_KV + fi + + local myconf="" + + use 3dnow \ + || myconf="${myconf} --disable-3dnow --disable-3dnowex" + + use sse \ + || myconf="${myconf} --disable-sse --disable-sse2" + + # Only disable MMX if 3DNOW or SSE is not in USE + use mmx || use 3dnow || use sse \ + || myconf="${myconf} --disable-mmx --disable-mmx2" + + # Only disable X if gtk is not in USE + use X || use gtk \ + || myconf="${myconf} --disable-gui --disable-x11 --disable-xv \ + --disable-xmga --disable-png" + + use matrox && use X \ + && myconf="${myconf} --enable-xmga" + + use gtk \ + && myconf="${myconf} --enable-gui --enable-x11 --enable-xv --enable-png" + + use oss \ + || myconf="${myconf} --disable-ossaudio" + + use opengl \ + || myconf="${myconf} --disable-gl" + + use sdl \ + || myconf="${myconf} --disable-sdl" + + use ggi \ + || myconf="${myconf} --disable-ggi" + + use svga \ + || myconf="${myconf} --disable-svga" + + use directfb \ + || myconf="${myconf} --disable-directfb" + + use fbcon \ + || myconf="${myconf} --disable-fbdev" + + use alsa \ + || myconf="${myconf} --disable-alsa" + + use oggvorbis \ + || myconf="${myconf} --disable-vorbis" + + use encode \ + && myconf="${myconf} --enable-mencoder --enable-tv" \ + || myconf="${myconf} --disable-mencoder" + +# Currently libdvdnav do not compile on gcc-3.1.1 +# use dvd \ +# && myconf="${myconf} --enable-dvdread --enable-dvdnav" \ +# || myconf="${myconf} --disable-mpdvdkit --disable-dvdread \ +# --disable-css --disable-dvdnav" + use dvd \ + && myconf="${myconf} --enable-dvdread" \ + || myconf="${myconf} --disable-mpdvdkit --disable-dvdread \ + --disable-css --disable-dvdnav" + + use matrox \ + && myconf="${myconf} --enable-mga" \ + || myconf="${myconf} --disable-mga" + + use 3dfx \ + && myconf="${myconf} --enable-3dfx --enable-tdfxfb" + + # Crashes on start when compiled with most optimizations. + # The code have CPU detection code now, with CPU specific + # optimizations, so extra should not be needed and is not + # recommended by the authors + unset CFLAGS CXXFLAGS + ./configure --prefix=/usr \ + --disable-runtime-cpudetection \ + --enable-largefiles \ + --enable-linux-devfs \ + ${myconf} || die + + # emake borks on fast boxes - Azarah (07 Aug 2002) + make all || die + + use matrox && ( \ + cd drivers + make all || die + ) +} + +src_install() { + + make prefix=${D}/usr \ + BINDIR=${D}/usr/bin \ + LIBDIR=${D}/usr/lib \ + CONFDIR=${D}/usr/share/mplayer \ + DATADIR=${D}/usr/share/mplayer \ + MANDIR=${D}/usr/share/man \ + install || die + + # Some stuff like transcode can use this one. + dolib ${S}/postproc/libpostproc.a + + # Install the documentation + dohtml -r ${S}/DOCS/* + + # Install the default Skin and Gnome menu entry + use gtk && ( \ + insinto /usr/share/mplayer/Skin/default + doins ${WORKDIR}/default/* + # Permissions is fried by default + chmod a+rx ${D}/usr/share/mplayer/Skin/default/ + chmod a+r ${D}/usr/share/mplayer/Skin/default/* + + # Fix the symlink + rm -rf ${D}/usr/bin/gmplayer + dosym /usr/bin/mplayer /usr/bin/gmplayer + ) + + use gnome && ( \ + insinto /usr/share/pixmaps + newins ${S}/Gui/mplayer/pixmaps/icon.xpm mplayer.xpm + insinto /usr/share/gnome/apps/Multimedia + doins ${FILESDIR}/mplayer.desktop + ) + + # Install the font used by OSD and the GUI + dodir /usr/share/mplayer/fonts + cp -a ${WORKDIR}/iso-8859-1/ ${D}/usr/share/mplayer/fonts + rm -rf ${D}/usr/share/mplayer/font + dosym /usr/share/mplayer/fonts/iso-8859-1/arial-14/ /usr/share/mplayer/font + + # This tries setting up mplayer.conf automagically + local video="sdl" audio="sdl" + use X && ( + use gtk && video="xv" \ + || use sdl && video="sdl" \ + || use xv && video="xv" \ + || use opengl && video="gl" \ + || use ggi && video="ggi" \ + || use dga && video="dga" \ + || video="x11" + ) || ( + use fbcon && video="fbdev" \ + || use svga && video="svga" \ + || use aalib && video="aa" + ) + + use sdl && audio="sdl" \ + || use alsa && ( + [ -e /usr/lib/libasound.so.2 ] && audio="alsa9" \ + || audio="alsa5" + ) || use oss audio="oss" \ + + # Note to myself: do not change " into ' + sed -e "s/vo=xv/vo=${video}/" \ + -e "s/ao=oss/ao=${audio}/" \ + -e 's/include =/#include =/' \ + ${S}/etc/example.conf > ${T}/mplayer.conf + + insinto /etc + doins ${T}/mplayer.conf + + insinto /usr/share/mplayer + doins ${S}/etc/codecs.conf + + use matrox && ( \ + dodir /lib/modules/${KV}/kernel/drivers/char + cp ${S}/drivers/mga_vid.o ${D}/lib/modules/${KV}/kernel/drivers/char + ) +} + +pkg_postinst() { + + echo + echo '######################################################################' + echo '# MPlayer users that are going to use the GUI, please note the #' + echo '# following: #' + echo '# #' + echo '# The GUI works best with mplayer -vo xv -gui, but since there is #' + echo '# no USE flag for XVideo, or for using the GUI, the autodetection #' + echo '# process cannot detect this by default (SDL will be used rather). #' + echo '# So, if your setup supports XVideo (xvinfo should give output), #' + echo '# maybe do something like: #' + echo '# #' + echo '# echo "vo = xv" >~/.mplayer/config #' + echo '# echo "gui = 1" >>~/.mplayer/config #' + echo '# #' + echo '# after launching mplayer for the first time. #' + echo '# #' + use gtk &>/dev/null \ + || echo '# NB: the GUI needs "gtk" as USE flag to build. #' + echo '######################################################################' + echo + depmod -a &>/dev/null || : +} + |