summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris White <chriswhite@gentoo.org>2004-07-18 06:46:07 +0000
committerChris White <chriswhite@gentoo.org>2004-07-18 06:46:07 +0000
commitcfefbb126c5d195270db2b0ddeb80f5013af938f (patch)
tree7a6a01d04032a44a5a53e4f4b887fc6632b6846e /media-video
parentsaved file before commiting it this time (Manifest recommit) (diff)
downloadgentoo-2-cfefbb126c5d195270db2b0ddeb80f5013af938f.tar.gz
gentoo-2-cfefbb126c5d195270db2b0ddeb80f5013af938f.tar.bz2
gentoo-2-cfefbb126c5d195270db2b0ddeb80f5013af938f.zip
Fixes realplayer bug and gives amd64 a stable ebuild for Bug #55456.
Diffstat (limited to 'media-video')
-rw-r--r--media-video/mplayer/ChangeLog9
-rw-r--r--media-video/mplayer/Manifest56
-rw-r--r--media-video/mplayer/files/amd64_fix_the_blue_love.patch411
-rw-r--r--media-video/mplayer/files/digest-mplayer-1.0_pre4-r55
-rw-r--r--media-video/mplayer/files/real_demux.patch111
-rw-r--r--media-video/mplayer/mplayer-1.0_pre4-r5.ebuild460
6 files changed, 1020 insertions, 32 deletions
diff --git a/media-video/mplayer/ChangeLog b/media-video/mplayer/ChangeLog
index d430865fa189..f8d8fde0be17 100644
--- a/media-video/mplayer/ChangeLog
+++ b/media-video/mplayer/ChangeLog
@@ -1,10 +1,17 @@
# ChangeLog for media-video/mplayer
# Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/ChangeLog,v 1.161 2004/07/16 09:53:41 kloeri Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/ChangeLog,v 1.162 2004/07/18 06:46:07 chriswhite Exp $
16 Jul 2004; Bryan Østergaard <kloeri@gentoo.org> mplayer-1.0_pre5.ebuild:
Stable on alpha, see bug #55456.
+*mplayer-1.0_pre4-r5 (18 Jul 2004)
+
+ 18 Jul 2004; Chris White <chriswhite@gentoo.org>
+ +files/amd64_fix_the_blue_love.patch, +files/real_demux.patch,
+ mplayer-1.0_pre4-r4.ebuild, +mplayer-1.0_pre4-r5.ebuild:
+ Fixes Bug #53634 and Bug #55456 for amd64.
+
15 Jul 2004; Jason Wever <weeve@gentoo.org> mplayer-1.0_pre5.ebuild:
Stable on sparc wrt bug #55456.
diff --git a/media-video/mplayer/Manifest b/media-video/mplayer/Manifest
index 8da6773f7a3a..769c8cf14a88 100644
--- a/media-video/mplayer/Manifest
+++ b/media-video/mplayer/Manifest
@@ -1,57 +1,51 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-MD5 105fb3b25e943c53085c3a221bb74832 ChangeLog 28441
+MD5 b06dd9576eb2961356dd6db22c00d82e ChangeLog 28698
MD5 9ef4af14dad87b03fde8e43f19e08d26 metadata.xml 225
+MD5 b813a65769af5d2a2ca1ceba1347974d mplayer-0.92-r1.ebuild 11511
MD5 7eeb1235c1263ecb110925e53de1eb06 mplayer-1.0_pre2-r1.ebuild 11375
MD5 8fd3c8b66040b26bb9f3963b5fe96bb2 mplayer-1.0_pre3-r3.ebuild 11498
-MD5 071a354aa3c0e9290b6dcfc8c3621d87 mplayer-1.0_pre4.ebuild 11319
MD5 d40969fad743a58087e55fd5d27d3fcf mplayer-1.0_pre3-r4.ebuild 11799
MD5 5d11f22039a718f19a725f676e614670 mplayer-1.0_pre3-r5.ebuild 11473
-MD5 b813a65769af5d2a2ca1ceba1347974d mplayer-0.92-r1.ebuild 11511
MD5 1c2c6d32766ce3bf0974895533252491 mplayer-1.0_pre4-r1.ebuild 11659
MD5 fbdd96b2a3f0f78bdc8cbded3bb3927b mplayer-1.0_pre4-r2.ebuild 11948
MD5 6b9e16c4f08ac48748812909ed431f31 mplayer-1.0_pre4-r3.ebuild 13034
-MD5 d13f33f9022f7abccfe9b14f96531057 mplayer-1.0_pre4-r4.ebuild 13157
+MD5 071a354aa3c0e9290b6dcfc8c3621d87 mplayer-1.0_pre4.ebuild 11319
MD5 7a9a4dc1f6172ff55b3ed5bd975b0286 mplayer-1.0_pre5.ebuild 13255
+MD5 4a7b94aa9e8b8817f3cc9ba1fe421128 mplayer-1.0_pre4-r5.ebuild 13292
+MD5 d13f33f9022f7abccfe9b14f96531057 mplayer-1.0_pre4-r4.ebuild 13157
+MD5 1f9260386b063367f192b6d5d65d6aea files/real_demux.patch 3107
MD5 6c2dab3392aab51766253b416ad2a10c files/default-skin.diff 396
-MD5 34f948b8f242a2aadb53a1e2b00e3155 files/vuln02-fix.diff 467
-MD5 8b8084aa31b466c55d15bd06bb77086d files/mplayer-1.0_pre3-xmms.patch 411
+MD5 deb1dbbf5879ed31e1b83fb7def5b600 files/digest-mplayer-0.92-r1 355
+MD5 b0205104d1242fcccdb5dfd2188f5ab2 files/digest-mplayer-1.0_pre2-r1 358
MD5 d74f7136fa5b4fa7d9ef13f8193dfe7c files/digest-mplayer-1.0_pre3-r3 358
-MD5 e2fc2cbbc8ebf183dcb599b66c999331 files/ppc750FX-fix.patch 515
+MD5 d74f7136fa5b4fa7d9ef13f8193dfe7c files/digest-mplayer-1.0_pre3-r4 358
+MD5 d74f7136fa5b4fa7d9ef13f8193dfe7c files/digest-mplayer-1.0_pre3-r5 358
+MD5 dc67207241f6a950a4d529557ebd4053 files/digest-mplayer-1.0_pre4 358
+MD5 dc67207241f6a950a4d529557ebd4053 files/digest-mplayer-1.0_pre4-r1 358
+MD5 dc67207241f6a950a4d529557ebd4053 files/digest-mplayer-1.0_pre4-r2 358
+MD5 dc67207241f6a950a4d529557ebd4053 files/digest-mplayer-1.0_pre4-r3 358
+MD5 e4581f6934f66ccecc8c1682664623d0 files/digest-mplayer-1.0_pre4-r4 358
+MD5 3aabe241ce3c7d60ea6f607cb7ab033a files/digest-mplayer-1.0_pre5 358
MD5 260489267a0ccf01fe300bce0ec1430d files/mencoder-segfault.patch 520
+MD5 98c7d58f544829621b15427ad53b98e4 files/mga-kernel-2.6.patch 16767
MD5 a71fc9832d953424652af1125fb7ea64 files/mplayer-0.90-coreutils-fixup.patch 1857
MD5 8f18911adcd661e70ad0cd84a94d49ac files/mplayer-0.90-divx.patch 25064
MD5 26a52f084f4d177580ed9ea0187f54e7 files/mplayer-0.90-ppc-benh-2.patch 2049
-MD5 d74f7136fa5b4fa7d9ef13f8193dfe7c files/digest-mplayer-1.0_pre3-r4 358
MD5 059e03d1d2c965b04a5e53ed850de64a files/mplayer-0.90_rc4-gtk2.patch 6183
MD5 c54c7ba8e18c8e7f3412c6d6939d010a files/mplayer-1.0-gtk2.patch 5903
-MD5 c2d65649f15837c5a326557ded4e47c5 files/mplayer.desktop 119
-MD5 fef9f0571da54ae3df2e804100bd2632 files/vuln01-fix.diff 1231
-MD5 d74f7136fa5b4fa7d9ef13f8193dfe7c files/digest-mplayer-1.0_pre3-r5 358
-MD5 fa86dd9d6980ff064efcc9d9f919905e files/mplayer-1.0_pre3-libmatroska063.diff 810
-MD5 deb1dbbf5879ed31e1b83fb7def5b600 files/digest-mplayer-0.92-r1 355
-MD5 b0205104d1242fcccdb5dfd2188f5ab2 files/digest-mplayer-1.0_pre2-r1 358
-MD5 dc67207241f6a950a4d529557ebd4053 files/digest-mplayer-1.0_pre4 358
MD5 a9fa1b94e4e3842e2c5e552644b03eaa files/mplayer-1.0_pre3-alsa-gcc34.patch 299
MD5 f998f1cad3da27cac3aea1982dc5c747 files/mplayer-1.0_pre3-libavcodec-gcc34.patch 5010
+MD5 fa86dd9d6980ff064efcc9d9f919905e files/mplayer-1.0_pre3-libmatroska063.diff 810
+MD5 8b8084aa31b466c55d15bd06bb77086d files/mplayer-1.0_pre3-xmms.patch 411
MD5 a9fa1b94e4e3842e2c5e552644b03eaa files/mplayer-1.0_pre4-alsa-gcc34.patch 299
-MD5 dc67207241f6a950a4d529557ebd4053 files/digest-mplayer-1.0_pre4-r1 358
-MD5 dc67207241f6a950a4d529557ebd4053 files/digest-mplayer-1.0_pre4-r2 358
-MD5 98c7d58f544829621b15427ad53b98e4 files/mga-kernel-2.6.patch 16767
-MD5 dc67207241f6a950a4d529557ebd4053 files/digest-mplayer-1.0_pre4-r3 358
-MD5 e4581f6934f66ccecc8c1682664623d0 files/digest-mplayer-1.0_pre4-r4 358
MD5 a39bd930af792269808dc4bdbc382fbb files/mplayer-1.0_pre4-altivec-gcc34.patch 650
MD5 aaadaff9756ff85c9855b2bbd50da184 files/mplayer-1.0_pre4-gcc34-mtune.patch 3493
MD5 42733acde24d84c1482db03c777360ab files/mplayer-1.0_pre4-help_mp-ro.h.patch 3267
-MD5 3aabe241ce3c7d60ea6f607cb7ab033a files/digest-mplayer-1.0_pre5 358
MD5 5cc95d6b380dc27e5ceae0f53ab88f99 files/mplayer-1.0_pre5-mga-kernel-2.6.patch 15043
MD5 ad254e1f8a5166ae1c5b53bc3c76ffd2 files/mplayer-1.0_pre5-yuv2rbg_kludge.patch 12585
+MD5 c2d65649f15837c5a326557ded4e47c5 files/mplayer.desktop 119
MD5 d7d214ab46189ad1138a0a37eaa859d4 files/noenca.patch 289
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.9.8 (GNU/Linux)
-
-iD8DBQFA+F6qHTu7gpaalycRAuYeAKCfQLe/l76+tKO3uk1RRfAp1D++SwCg5kmu
-S1LRuMVhH351u+69+u/2/GE=
-=YfJE
------END PGP SIGNATURE-----
+MD5 e2fc2cbbc8ebf183dcb599b66c999331 files/ppc750FX-fix.patch 515
+MD5 fef9f0571da54ae3df2e804100bd2632 files/vuln01-fix.diff 1231
+MD5 34f948b8f242a2aadb53a1e2b00e3155 files/vuln02-fix.diff 467
+MD5 084f1aa4fbe48d34c3154d5a4f238579 files/amd64_fix_the_blue_love.patch 17751
+MD5 e4581f6934f66ccecc8c1682664623d0 files/digest-mplayer-1.0_pre4-r5 358
diff --git a/media-video/mplayer/files/amd64_fix_the_blue_love.patch b/media-video/mplayer/files/amd64_fix_the_blue_love.patch
new file mode 100644
index 000000000000..9b96c00dc529
--- /dev/null
+++ b/media-video/mplayer/files/amd64_fix_the_blue_love.patch
@@ -0,0 +1,411 @@
+diff -Naur MPlayer-1.0pre4/Gui/Makefile MPlayer-1.0pre5/Gui/Makefile
+--- MPlayer-1.0pre4/Gui/Makefile 2003-04-05 00:39:51.000000000 +0900
++++ MPlayer-1.0pre5/Gui/Makefile 2004-06-28 04:17:24.000000000 +0900
+@@ -27,11 +27,12 @@
+ $(LIB): .depend $(OBJS)
+ rm -f $(LIB)
+ $(AR) rc $(LIB) $(OBJS) $(MPLAYEROBJS)
++ $(RANLIB) $(LIB)
+
+ all: $(LIB)
+
+ clean:
+- rm -rf $(OBJS) *.o *~ *.bak main $(PRG) $(LIB) .depend
++ rm -rf $(OBJS) *.o *~ *.bak main $(LIB) .depend
+
+ #dep: depend
+ #
+diff -Naur MPlayer-1.0pre4/Gui/interface.c MPlayer-1.0pre5/Gui/interface.c
+--- MPlayer-1.0pre4/Gui/interface.c 2004-03-26 06:49:47.000000000 +0900
++++ MPlayer-1.0pre5/Gui/interface.c 2004-06-26 22:26:10.000000000 +0900
+@@ -54,8 +56,12 @@
+ if ( *dest )
+ {
+ tmp=malloc( strlen( *dest ) + strlen( src ) + 1 );
+- strcpy( tmp,*dest ); strcat( tmp,src ); free( *dest );
+- }
++
++ if ( tmp ) /* TODO: advanced error handling */
++ {
++ strcpy( tmp,*dest ); strcat( tmp,src ); free( *dest );
++ }
++ }
+ else
+ { tmp=malloc( strlen( src ) + 1 ); strcpy( tmp,src ); }
+ *dest=tmp;
+diff -Naur MPlayer-1.0pre4/Gui/mplayer/common.c MPlayer-1.0pre5/Gui/mplayer/common.c
+--- MPlayer-1.0pre4/Gui/mplayer/common.c 2003-03-20 21:42:09.000000000 +0900
++++ MPlayer-1.0pre5/Gui/mplayer/common.c 2004-06-26 22:54:20.000000000 +0900
+@@ -30,37 +30,41 @@
+ #include "play.h"
+ #include "widgets.h"
+
+ extern unsigned int GetTimerMS( void );
+
+-inline void TranslateFilename( int c,char * tmp )
++inline void TranslateFilename( int c,char * tmp,size_t tmplen )
+ {
+ int i;
++ char * p;
++
+ switch ( guiIntfStruct.StreamType )
+ {
+ case STREAMTYPE_STREAM:
+- strcpy( tmp,guiIntfStruct.Filename );
++ strlcpy(tmp, guiIntfStruct.Filename, tmplen);
+ break;
+ case STREAMTYPE_FILE:
+ if ( ( guiIntfStruct.Filename )&&( guiIntfStruct.Filename[0] ) )
+ {
+- if ( strrchr( guiIntfStruct.Filename,'/' ) ) strcpy( tmp,strrchr( guiIntfStruct.Filename,'/' ) + 1 );
+- else strcpy( tmp,guiIntfStruct.Filename );
++ if ( p = strrchr(guiIntfStruct.Filename, '/') )
++ strlcpy(tmp, p + 1, tmplen);
++ else
++ strlcpy(tmp, guiIntfStruct.Filename, tmplen);
+ if ( tmp[strlen( tmp ) - 4] == '.' ) tmp[strlen( tmp ) - 4]=0;
+ if ( tmp[strlen( tmp ) - 5] == '.' ) tmp[strlen( tmp ) - 5]=0;
+- } else strcpy( tmp,MSGTR_NoFileLoaded );
++ } else strlcpy( tmp,MSGTR_NoFileLoaded,tmplen );
+ break;
+ #ifdef USE_DVDREAD
+ case STREAMTYPE_DVD:
+- if ( guiIntfStruct.DVD.current_chapter ) sprintf( tmp,MSGTR_Chapter,guiIntfStruct.DVD.current_chapter );
+- else strcat( tmp,MSGTR_NoChapter );
++ if ( guiIntfStruct.DVD.current_chapter ) snprintf(tmp,tmplen,MSGTR_Chapter,guiIntfStruct.DVD.current_chapter );
++ else strlcat( tmp,MSGTR_NoChapter,tmplen );
+ break;
+ #endif
+ #ifdef HAVE_VCD
+ case STREAMTYPE_VCD:
+- sprintf( tmp,MSGTR_VCDTrack,guiIntfStruct.Track );
++ snprintf( tmp,tmplen,MSGTR_VCDTrack,guiIntfStruct.Track );
+ break;
+ #endif
+- default: strcpy( tmp,MSGTR_NoMediaOpened );
++ default: strlcpy( tmp,MSGTR_NoMediaOpened,tmplen );
+ }
+ if ( c )
+ {
+@@ -74,75 +80,94 @@
+ }
+ }
+
++/* Unsafe! Pass only null-terminated strings as (char *)str. */
+ char * Translate( char * str )
+ {
+ static char trbuf[512];
+ char tmp[512];
+ int i,c;
+ int t;
++ int strsize = 0;
+ memset( trbuf,0,512 );
+ memset( tmp,0,128 );
+- for ( c=0,i=0;i < (int)strlen( str );i++ )
++ strsize = strlen(str);
++ for ( c=0,i=0;i < strsize;i++ )
+ {
+ if ( str[i] != '$' ) { trbuf[c++]=str[i]; trbuf[c]=0; }
+ else
+ {
+ switch ( str[++i] )
+ {
+- case 't': sprintf( tmp,"%02d",guiIntfStruct.Track ); strcat( trbuf,tmp ); break;
+- case 'o': TranslateFilename( 0,tmp ); strcat( trbuf,tmp ); break;
+- case 'f': TranslateFilename( 1,tmp ); strcat( trbuf,tmp ); break;
+- case 'F': TranslateFilename( 2,tmp ); strcat( trbuf,tmp ); break;
++ case 't': snprintf( tmp,sizeof( tmp ),"%02d",guiIntfStruct.Track );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 'o': TranslateFilename( 0,tmp,sizeof( tmp ) );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 'f': TranslateFilename( 1,tmp,sizeof( tmp ) );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 'F': TranslateFilename( 2,tmp,sizeof( tmp ) );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
+ case '6': t=guiIntfStruct.LengthInSec; goto calclengthhhmmss;
+ case '1': t=guiIntfStruct.TimeSec;
+ calclengthhhmmss:
+- sprintf( tmp,"%02d:%02d:%02d",t/3600,t/60%60,t%60 ); strcat( trbuf,tmp );
++ snprintf( tmp,sizeof( tmp ),"%02d:%02d:%02d",t/3600,t/60%60,t%60 );
++ strlcat( trbuf,tmp,sizeof( trbuf ) );
+ break;
+ case '7': t=guiIntfStruct.LengthInSec; goto calclengthmmmmss;
+ case '2': t=guiIntfStruct.TimeSec;
+ calclengthmmmmss:
+- sprintf( tmp,"%04d:%02d",t/60,t%60 ); strcat( trbuf,tmp );
++ snprintf( tmp,sizeof( tmp ),"%04d:%02d",t/60,t%60 );
++ strlcat( trbuf,tmp,sizeof( trbuf ) );
+ break;
+- case '3': sprintf( tmp,"%02d",guiIntfStruct.TimeSec / 3600 ); strcat( trbuf,tmp ); break;
+- case '4': sprintf( tmp,"%02d",( ( guiIntfStruct.TimeSec / 60 ) % 60 ) ); strcat( trbuf,tmp ); break;
+- case '5': sprintf( tmp,"%02d",guiIntfStruct.TimeSec % 60 ); strcat( trbuf,tmp ); break;
+- case '8': sprintf( tmp,"%01d:%02d:%02d",guiIntfStruct.TimeSec / 3600,( guiIntfStruct.TimeSec / 60 ) % 60,guiIntfStruct.TimeSec % 60 ); strcat( trbuf,tmp ); break;
+- case 'v': sprintf( tmp,"%3.2f%%",guiIntfStruct.Volume ); strcat( trbuf,tmp ); break;
+- case 'V': sprintf( tmp,"%3.1f",guiIntfStruct.Volume ); strcat( trbuf,tmp ); break;
+- case 'b': sprintf( tmp,"%3.2f%%",guiIntfStruct.Balance ); strcat( trbuf,tmp ); break;
+- case 'B': sprintf( tmp,"%3.1f",guiIntfStruct.Balance ); strcat( trbuf,tmp ); break;
+- case 'd': sprintf( tmp,"%d",guiIntfStruct.FrameDrop ); strcat( trbuf,tmp ); break;
+- case 'x': sprintf( tmp,"%d",guiIntfStruct.MovieWidth ); strcat( trbuf,tmp ); break;
+- case 'y': sprintf( tmp,"%d",guiIntfStruct.MovieHeight ); strcat( trbuf,tmp ); break;
+- case 'C': sprintf( tmp,"%s", guiIntfStruct.sh_video? ((sh_video_t *)guiIntfStruct.sh_video)->codec->name : "");
+- strcat( trbuf,tmp ); break;
+- case 's': if ( guiIntfStruct.Playing == 0 ) strcat( trbuf,"s" ); break;
+- case 'l': if ( guiIntfStruct.Playing == 1 ) strcat( trbuf,"p" ); break;
+- case 'e': if ( guiIntfStruct.Playing == 2 ) strcat( trbuf,"e" ); break;
++ case '3': snprintf( tmp,sizeof( tmp ),"%02d",guiIntfStruct.TimeSec / 3600 );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case '4': snprintf( tmp,sizeof( tmp ),"%02d",( ( guiIntfStruct.TimeSec / 60 ) % 60 ) );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case '5': snprintf( tmp,sizeof( tmp ),"%02d",guiIntfStruct.TimeSec % 60 );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case '8': snprintf( tmp,sizeof( tmp ),"%01d:%02d:%02d",guiIntfStruct.TimeSec / 3600,( guiIntfStruct.TimeSec / 60 ) % 60,guiIntfStruct.TimeSec % 60 ); strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 'v': snprintf( tmp,sizeof( tmp ),"%3.2f%%",guiIntfStruct.Volume );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 'V': snprintf( tmp,sizeof( tmp ),"%3.1f",guiIntfStruct.Volume );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 'b': snprintf( tmp,sizeof( tmp ),"%3.2f%%",guiIntfStruct.Balance );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 'B': snprintf( tmp,sizeof( tmp ),"%3.1f",guiIntfStruct.Balance );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 'd': snprintf( tmp,sizeof( tmp ),"%d",guiIntfStruct.FrameDrop );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 'x': snprintf( tmp,sizeof( tmp ),"%d",guiIntfStruct.MovieWidth );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 'y': snprintf( tmp,sizeof( tmp ),"%d",guiIntfStruct.MovieHeight );
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 'C': snprintf( tmp,sizeof( tmp ),"%s", guiIntfStruct.sh_video? ((sh_video_t *)guiIntfStruct.sh_video)->codec->name : "");
++ strlcat( trbuf,tmp,sizeof( trbuf ) ); break;
++ case 's': if ( guiIntfStruct.Playing == 0 ) strlcat( trbuf,"s",sizeof( trbuf ) ); break;
++ case 'l': if ( guiIntfStruct.Playing == 1 ) strlcat( trbuf,"p",sizeof( trbuf ) ); break;
++ case 'e': if ( guiIntfStruct.Playing == 2 ) strlcat( trbuf,"e",sizeof( trbuf ) ); break;
+ case 'a':
+- if ( muted ) { strcat( trbuf,"n" ); break; }
++ if ( muted ) { strlcat( trbuf,"n",sizeof( trbuf ) ); break; }
+ switch ( guiIntfStruct.AudioType )
+ {
+- case 0: strcat( trbuf,"n" ); break;
+- case 1: strcat( trbuf,"m" ); break;
+- case 2: strcat( trbuf,"t" ); break;
++ case 0: strlcat( trbuf,"n",sizeof( trbuf ) ); break;
++ case 1: strlcat( trbuf,"m",sizeof( trbuf ) ); break;
++ case 2: strlcat( trbuf,"t",sizeof( trbuf ) ); break;
+ }
+ break;
+ case 'T':
+ switch ( guiIntfStruct.StreamType )
+ {
+- case STREAMTYPE_FILE: strcat( trbuf,"f" ); break;
++ case STREAMTYPE_FILE: strlcat( trbuf,"f",sizeof( trbuf ) ); break;
+ #ifdef HAVE_VCD
+- case STREAMTYPE_VCD: strcat( trbuf,"v" ); break;
++ case STREAMTYPE_VCD: strlcat( trbuf,"v",sizeof( trbuf ) ); break;
+ #endif
+- case STREAMTYPE_STREAM: strcat( trbuf,"u" ); break;
++ case STREAMTYPE_STREAM: strlcat( trbuf,"u",sizeof( trbuf ) ); break;
+ #ifdef USE_DVDREAD
+- case STREAMTYPE_DVD: strcat( trbuf,"d" ); break;
++ case STREAMTYPE_DVD: strlcat( trbuf,"d",sizeof( trbuf ) ); break;
+ #endif
+- default: strcat( trbuf," " ); break;
++ default: strlcat( trbuf," ",sizeof( trbuf ) ); break;
+ }
+ break;
+- case '$': strcat( trbuf,"$" ); break;
++ case '$': strlcat( trbuf,"$",sizeof( trbuf ) ); break;
+ default: continue;
+ }
+ c=strlen( trbuf );
+diff -Naur MPlayer-1.0pre4/Gui/mplayer/gtk/about.c MPlayer-1.0pre5/Gui/mplayer/gtk/about.c
+--- MPlayer-1.0pre4/Gui/mplayer/gtk/about.c 2003-03-17 09:48:26.000000000 +0900
++++ MPlayer-1.0pre5/Gui/mplayer/gtk/about.c 2004-06-15 19:52:36.000000000 +0900
+@@ -105,7 +105,6 @@
+ " * Bertrand Baudet\n"
+ " * Derek J Witt\n"
+ " * Artur Zaprzala\n"
+- " * lanzz@lanzz.org\n"
+ " * Adam Tla/lka\n"
+ " * Folke Ashberg\n"
+ " * Kamil-"
+diff -Naur MPlayer-1.0pre4/Gui/skin/skin.c MPlayer-1.0pre5/Gui/skin/skin.c
+--- MPlayer-1.0pre4/Gui/skin/skin.c 2003-06-04 02:36:25.000000000 +0900
++++ MPlayer-1.0pre5/Gui/skin/skin.c 2004-06-26 01:49:52.000000000 +0900
+@@ -116,7 +116,7 @@
+ {
+ CHECKDEFLIST( "window" );
+
+- strcpy( window_name,strlower( in ) );
++ strlcpy( window_name,strlower( in ),sizeof( window_name ) );
+ if ( !strncmp( in,"main",4 ) ) { currSection=&skinAppMPlayer->main; currSubItem=&skinAppMPlayer->NumberOfItems; currSubItems=skinAppMPlayer->Items; }
+ else if ( !strncmp( in,"sub",3 ) ) currSection=&skinAppMPlayer->sub;
+ else if ( !strncmp( in,"playbar",7 ) ) { currSection=&skinAppMPlayer->bar; currSubItem=&skinAppMPlayer->NumberOfBarItems; currSubItems=skinAppMPlayer->barItems; }
+@@ -147,7 +147,7 @@
+ defList->main.x=x;
+ defList->main.y=y;
+ defList->main.type=itBase;
+- strcpy( tmp,path ); strcat( tmp,fname );
++ strlcpy(tmp, path, sizeof( tmp )); strlcat(tmp, fname, sizeof( tmp ));
+ if ( skinBPRead( tmp,&defList->main.Bitmap ) ) return 1;
+ defList->main.width=defList->main.Bitmap.Width;
+ defList->main.height=defList->main.Bitmap.Height;
+@@ -162,7 +162,7 @@
+ if ( !strcmp( window_name,"sub" ) )
+ {
+ defList->sub.type=itBase;
+- strcpy( tmp,path ); strcat( tmp,fname );
++ strlcpy(tmp, path, sizeof( tmp )); strlcat(tmp, fname, sizeof( tmp ));
+ if ( skinBPRead( tmp,&defList->sub.Bitmap ) ) return 1;
+ defList->sub.x=x;
+ defList->sub.y=y;
+@@ -179,7 +179,7 @@
+ {
+ defList->menuIsPresent=1;
+ defList->menuBase.type=itBase;
+- strcpy( tmp,path ); strcat( tmp,fname );
++ strlcpy(tmp, path, sizeof( tmp )); strlcat(tmp, fname, sizeof( tmp ));
+ if ( skinBPRead( tmp,&defList->menuBase.Bitmap ) ) return 1;
+ defList->menuBase.width=defList->menuBase.Bitmap.Width;
+ defList->menuBase.height=defList->menuBase.Bitmap.Height;
+@@ -197,7 +197,7 @@
+ defList->bar.x=x;
+ defList->bar.y=y;
+ defList->bar.type=itBase;
+- strcpy( tmp,path ); strcat( tmp,fname );
++ strlcpy(tmp, path, sizeof( tmp )); strlcat(tmp, fname, sizeof( tmp ));
+ if ( skinBPRead( tmp,&defList->bar.Bitmap ) ) return 1;
+ defList->bar.width=defList->bar.Bitmap.Width;
+ defList->bar.height=defList->bar.Bitmap.Height;
+@@ -268,7 +268,7 @@
+ currSubItems[ *currSubItem ].Bitmap.Image=NULL;
+ if ( strcmp( fname,"NULL" ) )
+ {
+- strcpy( tmp,path ); strcat( tmp,fname );
++ strlcpy(tmp, path, sizeof( tmp )); strlcat(tmp, fname, sizeof( tmp ));
+ if ( skinBPRead( tmp,&currSubItems[ *currSubItem ].Bitmap ) ) return 1;
+ }
+
+@@ -289,7 +289,7 @@
+
+ cutItem( in,fname,',',0 );
+ defList->menuSelected.type=itBase;
+- strcpy( tmp,path ); strcat( tmp,fname );
++ strlcpy(tmp, path, sizeof( tmp )); strlcat(tmp, fname, sizeof( tmp ));
+ mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"\n[skin] selected: %s\n",fname );
+ if ( skinBPRead( tmp,&defList->menuSelected.Bitmap ) ) return 1;
+ defList->menuSelected.width=defList->menuSelected.Bitmap.Width;
+@@ -381,14 +381,14 @@
+ item->Bitmap.Image=NULL;
+ if ( strcmp( phfname,"NULL" ) )
+ {
+- strcpy( tmp,path ); strcat( tmp,phfname );
++ strlcpy(tmp, path, sizeof( tmp )); strlcat(tmp, phfname, sizeof( tmp ));
+ if ( skinBPRead( tmp,&item->Bitmap ) ) return 1;
+ }
+
+ item->Mask.Image=NULL;
+ if ( strcmp( pfname,"NULL" ) )
+ {
+- strcpy( tmp,path ); strcat( tmp,pfname );
++ strlcpy(tmp, path, sizeof( tmp )); strlcat(tmp, pfname, sizeof( tmp ));
+ if ( skinBPRead( tmp,&item->Mask ) ) return 1;
+ }
+ return 0;
+@@ -445,7 +445,7 @@
+ item->Bitmap.Image=NULL;
+ if ( strcmp( phfname,"NULL" ) )
+ {
+- strcpy( tmp,path ); strcat( tmp,phfname );
++ strlcpy(tmp, path, sizeof( tmp )); strlcat(tmp, phfname, sizeof( tmp ));
+ if ( skinBPRead( tmp,&item->Bitmap ) ) return 1;
+ }
+ return 0;
+@@ -655,7 +655,12 @@
+ FILE * skinFile;
+
+ void setname( char * item1, char * item2 )
+-{ strcpy( fn,item1 ); strcat( fn,"/" ); strcat( fn,item2 ); strcpy( path,fn ); strcat( path,"/" ); strcat( fn,"/skin" ); }
++{
++ strlcpy(fn, item1, sizeof( fn ));
++ strlcat(fn, "/", sizeof( fn )); strlcat(fn, item2, sizeof( fn ));
++ strlcpy(path, fn, sizeof( path )); strlcat(path, "/", sizeof( path ));
++ strlcat(fn, "/skin", sizeof( fn ));
++}
+
+ int skinRead( char * dname )
+ {
+diff -Naur MPlayer-1.0pre4/Gui/wm/ws.c MPlayer-1.0pre5/Gui/wm/ws.c
+--- MPlayer-1.0pre4/Gui/wm/ws.c 2003-12-01 01:36:04.000000000 +0900
++++ MPlayer-1.0pre5/Gui/wm/ws.c 2004-07-12 07:27:18.000000000 +0900
+@@ -754,37 +770,57 @@
+
+ if ( win->isFullScreen )
+ {
+- win->X=win->OldX;
+- win->Y=win->OldY;
+- win->Width=win->OldWidth;
+- win->Height=win->OldHeight;
+- win->isFullScreen=False;
+- decoration=win->Decorations;
++ vo_x11_ewmh_fullscreen( 0 ); // removes fullscreen state if wm supports EWMH
++ if ( ! (vo_fs_type & vo_wm_FULLSCREEN) ) // shouldn't be needed with EWMH fs
++ {
++ win->X=win->OldX;
++ win->Y=win->OldY;
++ win->Width=win->OldWidth;
++ win->Height=win->OldHeight;
++ decoration=win->Decorations;
++ }
++
+ #ifdef ENABLE_DPMS
+ wsScreenSaverOn( wsDisplay );
+ #endif
++
++ win->isFullScreen=False;
+ }
+ else
+ {
+- win->OldX=win->X; win->OldY=win->Y;
+- win->OldWidth=win->Width; win->OldHeight=win->Height;
+- win->X=wsOrgX; win->Y=wsOrgY;
+- win->Width=wsMaxX; win->Height=wsMaxY;
++ if ( ! (vo_fs_type & vo_wm_FULLSCREEN) ) // shouldn't be needed with EWMH fs
++ {
++ win->OldX=win->X; win->OldY=win->Y;
++ win->OldWidth=win->Width; win->OldHeight=win->Height;
++ win->X=wsOrgX; win->Y=wsOrgY;
++ win->Width=wsMaxX; win->Height=wsMaxY;
++ }
++
+ win->isFullScreen=True;
+ #ifdef ENABLE_DPMS
+ wsScreenSaverOff( wsDisplay );
+ #endif
++
++ vo_x11_ewmh_fullscreen( 1 ); // adds fullscreen state if wm supports EWMH
+ }
+
+- vo_x11_decoration( wsDisplay,win->WindowID,decoration );
+- vo_x11_sizehint( win->X,win->Y,win->Width,win->Height,0 );
+- vo_x11_setlayer( wsDisplay,win->WindowID,win->isFullScreen );
++ if ( ! (vo_fs_type & vo_wm_FULLSCREEN) ) // shouldn't be needed with EWMH fs
++ {
++ vo_x11_decoration( wsDisplay,win->WindowID,decoration );
++ vo_x11_sizehint( win->X,win->Y,win->Width,win->Height,0 );
++ vo_x11_setlayer( wsDisplay,win->WindowID,win->isFullScreen );
+
+-if ((!(win->isFullScreen)) & vo_ontop) vo_x11_setlayer(wsDisplay, win->WindowID,1);
++ if ((!(win->isFullScreen)) & vo_ontop) vo_x11_setlayer(wsDisplay, win->WindowID,1);
++
++ XMoveResizeWindow( wsDisplay,win->WindowID,win->X,win->Y,win->Width,win->Height );
++ }
+
+ if ( vo_wm_type == 0 && !(vo_fsmode&16) )
+- XWithdrawWindow( wsDisplay,win->WindowID,wsScreen );
+- XMoveResizeWindow( wsDisplay,win->WindowID,win->X,win->Y,win->Width,win->Height );
++ {
++ XWithdrawWindow( wsDisplay,win->WindowID,wsScreen );
++ }
++
++
+ XMapRaised( wsDisplay,win->WindowID );
+ XRaiseWindow( wsDisplay,win->WindowID );
+ XFlush( wsDisplay );
diff --git a/media-video/mplayer/files/digest-mplayer-1.0_pre4-r5 b/media-video/mplayer/files/digest-mplayer-1.0_pre4-r5
new file mode 100644
index 000000000000..18d8bea4d6ed
--- /dev/null
+++ b/media-video/mplayer/files/digest-mplayer-1.0_pre4-r5
@@ -0,0 +1,5 @@
+MD5 83ebac0f05b192516a41fca2350ca01a MPlayer-1.0pre4.tar.bz2 4913390
+MD5 1ecd31d17b51f16332b1fcc7da36b312 font-arial-iso-8859-1.tar.bz2 234242
+MD5 7b47904a925cf58ea546ca15f3df160c font-arial-iso-8859-2.tar.bz2 222208
+MD5 3f1b9eb2ba639bf42c61f7b9189f6524 svgalib_helper-1.9.17-mplayer.tar.bz2 7234
+MD5 5fdc36704c4ec3a6dc6b57a536608180 Blue-1.4.tar.bz2 221734
diff --git a/media-video/mplayer/files/real_demux.patch b/media-video/mplayer/files/real_demux.patch
new file mode 100644
index 000000000000..b718f602feb6
--- /dev/null
+++ b/media-video/mplayer/files/real_demux.patch
@@ -0,0 +1,111 @@
+--- libmpdemux/demux_real.c 2004-04-28 05:04:26.000000000 +0900
++++ libmpdemux/demux_real.c 2004-06-26 03:45:56.000000000 +0900
+@@ -207,7 +207,6 @@
+ goto read_index;
+
+ end:
+- demuxer->seekable = 1; /* got index, we're able to seek */
+ if (i == -256)
+ stream_reset(demuxer->stream);
+ stream_seek(demuxer->stream, origpos);
+@@ -221,7 +220,7 @@
+
+ static void add_index_item(demuxer_t *demuxer, int stream_id, int timestamp, int offset)
+ {
+- if (index_mode > 0 && (unsigned)stream_id < MAX_STREAMS)
++ if ((unsigned)stream_id < MAX_STREAMS)
+ {
+ real_priv_t *priv = demuxer->priv;
+ real_index_table_t *index;
+@@ -242,7 +241,6 @@
+ index = &priv->index_table[stream_id][priv->index_table_size[stream_id]++];
+ index->timestamp = timestamp;
+ index->offset = offset;
+- demuxer->seekable = 1;
+ }
+ }
+
+@@ -308,13 +306,11 @@
+ stream_skip(demuxer->stream, 14);
+ add_index_segment(demuxer, -1, -1);
+ }
+- demuxer->seekable = 0;
+ for (i = 0; i < MAX_STREAMS; i++)
+ {
+ if (priv->index_table_size[i] > 0)
+ {
+ dump_index(demuxer, i);
+- demuxer->seekable = 1; /* got index, we're able to seek */
+ }
+ }
+ stream_reset(demuxer->stream);
+@@ -406,7 +402,6 @@
+ goto read_index;
+
+ end:
+- demuxer->seekable = 1; /* got index, we're able to seek */
+ if (i == -256)
+ stream_reset(demuxer->stream);
+ stream_seek(demuxer->stream, origpos);
+@@ -1193,10 +1188,6 @@
+ sh->wf->cbSize = 0;
+ sh->format = MKTAG(buf[0], buf[1], buf[2], buf[3]);
+
+- if ((version != 3) && (hdr_size != 0x4e)) {
+- mp_msg(MSGT_DEMUX,MSGL_V,"skipping %d extra header bytes\n", hdr_size-0x4e);
+- stream_skip(demuxer->stream, hdr_size-0x4e);
+- }
+ #if 0
+ switch (sh->format){
+ case MKTAG('d', 'n', 'e', 't'):
+@@ -1465,16 +1456,35 @@
+ if (priv->num_of_packets == 0)
+ priv->num_of_packets = -10;
+
+- /* disable seeking */
+- demuxer->seekable = 0;
+
+ priv->audio_need_keyframe = 0;
+ priv->video_after_seek = 0;
+
+- if (index_mode == 2)
+- generate_index(demuxer);
+- else if (priv->index_chunk_offset && (index_mode == 1))
+- parse_index_chunk(demuxer);
++ switch (index_mode){
++ case -1: // untouched
++ if (priv->index_chunk_offset && (priv->index_chunk_offset < demuxer->movi_end))
++ {
++ parse_index_chunk(demuxer);
++ demuxer->seekable = 1;
++ }
++ break;
++ case 1: // use (generate index)
++ if (priv->index_chunk_offset && (priv->index_chunk_offset < demuxer->movi_end))
++ {
++ parse_index_chunk(demuxer);
++ demuxer->seekable = 1;
++ } else {
++ generate_index(demuxer);
++ demuxer->seekable = 1;
++ }
++ break;
++ case 2: // force generating index
++ generate_index(demuxer);
++ demuxer->seekable = 1;
++ break;
++ default: // do nothing
++ break;
++ }
+
+ // detect streams:
+ if(demuxer->video->id==-1 && v_streams>0){
+@@ -1525,8 +1535,6 @@
+ int streams = 0;
+ int retried = 0;
+
+- if ((index_mode != 1) && (index_mode != 2))
+- return 0;
+
+ if (sh_video && (unsigned)vid < MAX_STREAMS && priv->index_table_size[vid])
+ streams |= 1;
diff --git a/media-video/mplayer/mplayer-1.0_pre4-r5.ebuild b/media-video/mplayer/mplayer-1.0_pre4-r5.ebuild
new file mode 100644
index 000000000000..8e063405d42c
--- /dev/null
+++ b/media-video/mplayer/mplayer-1.0_pre4-r5.ebuild
@@ -0,0 +1,460 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/mplayer-1.0_pre4-r5.ebuild,v 1.1 2004/07/18 06:46:07 chriswhite Exp $
+
+inherit eutils flag-o-matic kmod
+
+IUSE="3dfx 3dnow X aalib alsa arts bidi debug directfb divx4linux dvb dvd encode esd fbcon ggi gif gnome gtk ipv6 joystick jpeg libcaca lirc live mad matroska matrox mmx mpeg nas nls oggvorbis opengl oss png samba sdl sse svga theora truetype v4l v4l2 xinerama xmms xvid"
+
+# 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.
+
+BLUV=1.4
+SVGV=1.9.17
+
+# Handle PREversions as well
+MY_PV="${PV/_/}"
+S="${WORKDIR}/MPlayer-${MY_PV}"
+SRC_URI="mirror://mplayer/releases/MPlayer-${MY_PV}.tar.bz2
+ mirror://mplayer/releases/fonts/font-arial-iso-8859-1.tar.bz2
+ mirror://mplayer/releases/fonts/font-arial-iso-8859-2.tar.bz2
+ svga? ( http://mplayerhq.hu/~alex/svgalib_helper-${SVGV}-mplayer.tar.bz2 )
+ gtk? ( mirror://mplayer/Skin/Blue-${BLUV}.tar.bz2 )"
+# Only install Skin if GUI should be build (gtk as USE flag)
+DESCRIPTION="Media Player for Linux"
+HOMEPAGE="http://www.mplayerhq.hu/"
+
+# 'encode' in USE for MEncoder.
+RDEPEND="xvid? (
+ ppc? ( >=media-libs/xvid-0.9.0 )
+ amd64? ( >=media-libs/xvid-0.9.0 )
+ x86? ( >=media-libs/xvid-0.9.0 )
+ )
+ x86? ( divx4linux? ( >=media-libs/divx4linux-20030428 )
+ >=media-libs/win32codecs-0.60 )
+ png? ( media-libs/libpng )
+ gtk? ( media-libs/libpng
+ virtual/x11
+ =x11-libs/gtk+-1.2*
+ =dev-libs/glib-1.2* )
+ xinerama? ( virtual/x11 )
+ jpeg? ( media-libs/jpeg )
+ gif? ( media-libs/giflib
+ media-libs/libungif )
+ truetype? ( >=media-libs/freetype-2.1 )
+ esd? ( media-sound/esound )
+ ggi? ( media-libs/libggi )
+ sdl? ( media-libs/libsdl )
+ alsa? ( media-libs/alsa-lib )
+ arts? ( kde-base/arts )
+ nas? ( media-libs/nas )
+ lirc? ( app-misc/lirc )
+ aalib? ( media-libs/aalib )
+ svga? ( media-libs/svgalib )
+ encode? ( media-sound/lame
+ >=media-libs/libdv-0.9.5 )
+ xmms? ( media-sound/xmms )
+ matroska? ( >=media-libs/libmatroska-0.6.0 )
+ opengl? ( virtual/opengl )
+ directfb? ( dev-libs/DirectFB )
+ oggvorbis? ( media-libs/libvorbis )
+ nls? ( sys-devel/gettext )
+ media-sound/cdparanoia
+ mpeg? ( media-libs/faad2 )
+ samba? ( >=net-fs/samba-2.2.8a )
+ theora? ( media-libs/libtheora )
+ live? ( >=media-plugins/live-2004.01.05 )
+ mad? ( media-libs/libmad )
+ bidi? ( dev-libs/fribidi )
+ libcaca? ( media-libs/libcaca )
+ >=sys-apps/portage-2.0.36"
+# dvd? ( media-libs/libdvdnav )
+# Hardcode paranoia support for now, as there is no
+# related USE flag.
+
+DEPEND="${RDEPEND}
+ x86? ( dev-lang/nasm )
+ app-arch/unzip"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~x86 ~ppc ~alpha amd64 -ia64 -hppa ~sparc"
+
+
+pkg_setup() {
+ echo
+ einfo "Please note that we do not use C[XX]FLAGS from /etc/make.conf"
+ einfo "or the environment, as the MPlayer guys then do not give support"
+ einfo "in case of bug reports!."
+ echo
+ echo -ne "\a" ; sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null
+ echo -ne "\a" ; sleep 1
+ echo -ne "\a" ; sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null
+ echo -ne "\a" ; sleep 1
+ sleep 3
+}
+
+src_unpack() {
+
+ unpack MPlayer-${MY_PV}.tar.bz2 \
+ font-arial-iso-8859-1.tar.bz2 font-arial-iso-8859-2.tar.bz2
+
+ use svga && unpack svgalib_helper-${SVGV}-mplayer.tar.bz2
+
+ use gtk && unpack Blue-${BLUV}.tar.bz2
+
+ cd ${S}
+
+
+ # fixes bug #55456 for amd64
+ use amd64 && epatch ${FILESDIR}/amd64_fix_the_blue_love.patch
+
+ # Fix head/tail call for new coreutils
+ epatch ${FILESDIR}/${PN}-0.90-coreutils-fixup.patch
+
+ #bug #49669, horrid syntax errors in help/help_mp-ro.h
+ epatch ${FILESDIR}/${P}-help_mp-ro.h.patch
+
+ #fixes bug #53634
+ epatch ${FILESDIR}/real_demux.patch
+
+ epatch ${FILESDIR}/${P}-alsa-gcc34.patch
+ epatch ${FILESDIR}/${P}-altivec-gcc34.patch
+ epatch ${FILESDIR}/${P}-gcc34-mtune.patch
+ # fixes for mga driver with kernel 2.6
+ if use matrox; then
+ get_kernel_info
+
+ epatch ${FILESDIR}/mga-kernel-2.6.patch
+ sed -i -e "s/KERNEL_VERSION_HERE/${KV_VERSION_FULL}/" drivers/Makefile \
+ || die "sed failed on kernel version substitution"
+
+ # preparing build for 2.6 mga kernel module
+ cp ${KV_OUTPUT}/.config ${T}/
+ ln -s /usr/src/linux/scripts ${T}/
+ ln -s /usr/src/linux/include ${T}/
+ sed -e "s:SUBDIRS:O=${T} SUBDIRS:" -i drivers/Makefile \
+ || die "sed failed setting O=${T}"
+ sed -e "s:^MDIR = .*:MDIR = ${D}/lib/modules/${KV_VERSION_FULL}/kernel/drivers/char/:" -i drivers/Makefile \
+ || die "sed failed correcting module install path"
+ sed -e "s:depmod -a::" -i drivers/Makefile \
+ || die "sed failed removing depmod"
+
+ fi # end of matrox related stuff
+
+ # Fix hppa compilation
+ [ "${ARCH}" = "hppa" ] && sed -i -e "s/-O4/-O1/" "${S}/configure"
+
+ if use svga
+ then
+ echo
+ einfo "Enabling vidix non-root mode."
+ einfo "(You need a proper svgalib_helper.o module for your kernel"
+ einfo " to actually use this)"
+ echo
+
+ mv ${WORKDIR}/svgalib_helper ${S}/libdha
+ cd ${S}/libdha
+ sed -i -e "s/^#CFLAGS/CFLAGS/" Makefile
+ fi
+}
+
+src_compile() {
+
+ filter-flags -fPIC
+
+ use matrox && check_KV
+
+ 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"
+
+ use png || use gtk \
+ || myconf="${myconf} --disable-png"
+
+ ( use matrox && use X ) \
+ && myconf="${myconf} --enable-xmga" \
+ || myconf="${myconf} --disable-xmga"
+
+ use gtk \
+ && myconf="${myconf} --enable-gui --enable-x11 \
+ --enable-xv --enable-vm --enable-png"
+ use png \
+ && myconf="${myconf} --enable-png"
+
+ myconf="${myconf} `use_enable encode mencoder`"
+ use encode && myconf="${myconf} --enable-tv"
+
+ myconf="${myconf} `use_enable dvd mpdvdkit`"
+ use dvd || myconf="${myconf} --disable-dvdread"
+
+ # Disable dvdnav support as its not considered to be
+ # functional anyhow, and will be removed.
+
+ myconf="${myconf} `use_enable dvb`"
+ use dvb || myconf="${myconf} --disable-dvbhead"
+
+ #if the flag is enabled, use external rather then internal
+ use matroska && myconf="${myconf} --disable-internal-matroska"
+ use mpeg && myconf="${myconf} --disable-internal-faad"
+
+ mconf="${myconf} `use_enable xvid`"
+ ( use xvid && use 3dfx ) \
+ && myconf="${myconf} --enable-tdfxvid" \
+ || myconf="${myconf} --disable-tdfxvid"
+
+ use gif \
+ || myconf="${myconf} --disable-gif"
+
+ use debug \
+ && myconf="${myconf} --enable-debug"
+
+ if [ -d /opt/RealPlayer9/Real/Codecs ]
+ then
+ einfo "Setting REALLIBDIR to /opt/RealPlayer9/Real/Codecs..."
+ REALLIBDIR="/opt/RealPlayer9/Real/Codecs"
+ elif [ -d /opt/RealPlayer8/Codecs ]
+ then
+ einfo "Setting REALLIBDIR to /opt/RealPlayer8/Codecs..."
+ REALLIBDIR="/opt/RealPlayer8/Codecs"
+ else
+ REALLIBDIR="/usr/lib/real"
+ fi
+
+ if [ -e /dev/.devfsd ]
+ then
+ myconf="${myconf} --enable-linux-devfs"
+ fi
+
+ has_pic && CC="${CC} `test_flag -fno-pic` `test_flag -nopie`"
+
+ # 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 \
+ --datadir=/usr/share/mplayer \
+ --confdir=/usr/share/mplayer \
+ --disable-runtime-cpudetection \
+ --enable-largefiles \
+ --enable-menu \
+ --enable-real \
+ --with-reallibdir=${REALLIBDIR} \
+ --with-x11incdir=/usr/X11R6/include \
+ `use_enable xinerama` \
+ `use_enable oggvorbis vorbis` \
+ `use_enable esd` \
+ `use_enable truetype freetype` \
+ `use_enable opengl gl` \
+ `use_enable libcaca caca` \
+ `use_enable sdl` \
+ `use_enable nls i18n` \
+ `use_enable samba smb` \
+ `use_enable aalib aa` \
+ `use_enable oss ossaudio` \
+ `use_enable ggi` \
+ `use_enable svga` \
+ `use_enable directfb` \
+ `use_enable fbcon fbdev` \
+ `use_enable alsa` \
+ `use_enable arts` \
+ `use_enable lirc` \
+ `use_enable joystick` \
+ `use_enable theora` \
+ `use_enable bidi fribidi` \
+ `use_enable nas` \
+ `use_enable 3dfx tdfxfb` \
+ `use_enable matrox mga` \
+ `use_enable xmms` \
+ `use_enable ipv6 inet6` \
+ `use_enable live` \
+ `use_enable v4l tv-v4l` \
+ `use_enable v4l2 tv-v4l2` \
+ `use_enable mpeg external-faad` \
+ `use_enable matroska external-matroska` \
+ `use_enable jpeg` \
+ `use_enable mad` \
+ `use_enable divx4linux` \
+ ${myconf} || die
+ # Breaks with gcc-2.95.3, bug #14479:
+ # --enable-shared-pp \
+ # Enable untested and currently unused code:
+ # --enable-dynamic-plugins \
+
+ # emake borks on fast boxes - Azarah (07 Aug 2002)
+ einfo "Make"
+ make all || die "Failed to build MPlayer!"
+ einfo "Make completed"
+
+ # We build the shared libpostproc.so here so that our
+ # mplayer binary is not linked to it, ensuring that we
+ # do not run into issues ... (bug #14479)
+ cd ${S}/libavcodec/libpostproc
+ make SHARED_PP="yes" || die "Failed to build libpostproc.so!"
+
+ if use matrox
+ then
+ unset ARCH
+ local driverwasbuilt="ok"
+ local dirtytrick="no"
+ local oldwrite="${SANDBOX_WRITE}"
+ cd ${S}/drivers
+ if [ ${KV_MAJOR}.${KV_MINOR} = "2.6" -a ${KV_PATCH} -le 5 ]; then
+ einfo "Kernel < 2.6.6, have to remove your include/asm and .config"
+ einfo "temporarily. Putting them into ${T}, will try to restore them later."
+ dirtytrick="yes"
+ addwrite /usr/src/linux/
+ mv /usr/src/linux/.config ${T}/savedconfig
+ mv /usr/src/linux/include/asm ${T}/savedasm
+ SANDBOX_WRITE="${oldwrite}"
+ fi
+ make all || driverwasbuilt="no"
+ if [ ${dirtytrick} = "yes" ]; then
+ addwrite /usr/src/linux
+ mv ${T}/savedconfig /usr/src/linux/.config
+ mv ${T}/savedasm /usr/src/linux/include/asm
+ SANDBOX_WRITE="${oldwrite}"
+ fi
+ if [ ${driverwasbuilt} = "no" ]; then
+ die "Failed to build matrox driver!"
+ fi
+ fi
+}
+
+src_install() {
+
+ einfo "Make 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 "Failed to install MPlayer!"
+ einfo "Make install completed"
+
+ if use matrox; then
+ cd ${S}/drivers
+ insinto /lib/modules/${KV}/kernel/drivers/char
+ doins mga_vid.${KV_OBJ}
+ fi
+
+ # libpostproc is now installed by >=ffmpeg-0.4.8.20040222
+# cd ${S}/libavcodec/libpostproc
+# make prefix=${D}/usr \
+# SHARED_PP="yes" \
+# install || die "Failed to install libpostproc.so!"
+# cd ${S}
+
+ dodoc AUTHORS ChangeLog README
+ # Install the documentation; DOCS is all mixed up not just html
+ find ${S}/DOCS -type d | xargs -- chmod 0755
+ cp -r ${S}/DOCS ${D}/usr/share/doc/${PF}/ || die
+
+ # Copy misc tools to documentation path, as they're not installed
+ # directly
+ find ${S}/TOOLS -type d | xargs -- chmod 0755
+ cp -r ${S}/TOOLS ${D}/usr/share/doc/${PF} || die
+
+ # Install the default Skin and Gnome menu entry
+ if use gtk
+ then
+ dodir /usr/share/mplayer/Skin
+ cp -r ${WORKDIR}/Blue ${D}/usr/share/mplayer/Skin/default || die
+
+ # Fix the symlink
+ rm -rf ${D}/usr/bin/gmplayer
+ dosym mplayer /usr/bin/gmplayer
+ fi
+
+ if use gnome
+ then
+ insinto /usr/share/pixmaps
+ newins ${S}/Gui/mplayer/pixmaps/logo.xpm mplayer.xpm
+ insinto /usr/share/gnome/apps/Multimedia
+ doins ${FILESDIR}/mplayer.desktop
+ fi
+
+ dodir /usr/share/mplayer/fonts
+ local x=
+ # Do this generic, as the mplayer people like to change the structure
+ # of their zips ...
+ for x in $(find ${WORKDIR}/ -type d -name 'font-arial-??-iso-*')
+ do
+ cp -Rd ${x} ${D}/usr/share/mplayer/fonts
+ done
+ # Fix the font symlink ...
+ rm -rf ${D}/usr/share/mplayer/font
+ dosym fonts/font-arial-14-iso-8859-1 /usr/share/mplayer/font
+
+ insinto /etc
+ newins ${S}/etc/example.conf mplayer.conf
+ dosed -e 's/include =/#include =/' /etc/mplayer.conf
+ dosed -e 's/fs=yes/fs=no/' /etc/mplayer.conf
+ dosym ../../../etc/mplayer.conf /usr/share/mplayer/mplayer.conf
+
+ insinto /usr/share/mplayer
+ doins ${S}/etc/codecs.conf
+ doins ${S}/etc/input.conf
+ doins ${S}/etc/menu.conf
+}
+
+pkg_preinst() {
+
+ if [ -d "${ROOT}/usr/share/mplayer/Skin/default" ]
+ then
+ rm -rf ${ROOT}/usr/share/mplayer/Skin/default
+ fi
+}
+
+pkg_postinst() {
+
+ if use ppc
+ then
+ echo
+ einfo "When you see only GREEN salad on your G4 while playing"
+ einfo "a DivX, you should recompile _without_ altivec enabled."
+ einfo "Further information: http://bugs.gentoo.org/show_bug.cgi?id=18511"
+ echo
+ einfo "If everything functions fine with watching DivX and"
+ einfo "altivec enabled, please drop a comment on the mentioned bug!"
+ echo
+ einfo "libpostproc is no longer installed by mplayer. If you have an"
+ einfo "application that depends on it, install >=ffmpeg-0.4.8.20040222"
+ fi
+
+ if use matrox; then
+ depmod -a &>/dev/null || :
+ fi
+}
+
+pkg_postrm() {
+
+ # Cleanup stale symlinks
+ if [ -L ${ROOT}/usr/share/mplayer/font -a \
+ ! -e ${ROOT}/usr/share/mplayer/font ]
+ then
+ rm -f ${ROOT}/usr/share/mplayer/font
+ fi
+
+ if [ -L ${ROOT}/usr/share/mplayer/subfont.ttf -a \
+ ! -e ${ROOT}/usr/share/mplayer/subfont.ttf ]
+ then
+ rm -f ${ROOT}/usr/share/mplayer/subfont.ttf
+ fi
+}