From 441e3e19d6d20d57fd93dc01beaccbd2639f6159 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 26 Oct 2007 19:47:35 +0000 Subject: [PATCH] * MPlayer 1.0rc2. svn path=/nixpkgs/trunk/; revision=9535 --- .../video/MPlayer/asmrules-fix.patch | 68 ----------- pkgs/applications/video/MPlayer/default.nix | 30 +++-- .../video/MPlayer/mplayer-aspect.patch | 96 --------------- .../video/MPlayer/mplayer-pivot.patch | 112 ------------------ .../video/MPlayer/win32codecs/default.nix | 6 +- pkgs/top-level/all-packages.nix | 2 +- 6 files changed, 21 insertions(+), 293 deletions(-) delete mode 100644 pkgs/applications/video/MPlayer/asmrules-fix.patch delete mode 100644 pkgs/applications/video/MPlayer/mplayer-aspect.patch delete mode 100644 pkgs/applications/video/MPlayer/mplayer-pivot.patch diff --git a/pkgs/applications/video/MPlayer/asmrules-fix.patch b/pkgs/applications/video/MPlayer/asmrules-fix.patch deleted file mode 100644 index efdfe6b307dd..000000000000 --- a/pkgs/applications/video/MPlayer/asmrules-fix.patch +++ /dev/null @@ -1,68 +0,0 @@ -diff -rc MPlayer-1.0rc1-orig/stream/realrtsp/asmrp.c MPlayer-1.0rc1/stream/realrtsp/asmrp.c -*** MPlayer-1.0rc1-orig/stream/realrtsp/asmrp.c 2006-10-23 00:32:25.000000000 +0200 ---- MPlayer-1.0rc1/stream/realrtsp/asmrp.c 2007-01-14 19:11:06.000000000 +0100 -*************** -*** 40,45 **** ---- 40,46 ---- - #include - #include - #include -+ #include "asmrp.h" - - /* - #define LOG -*************** -*** 645,652 **** - #ifdef LOG - printf ("rule #%d is true\n", rule_num); - #endif -! matches[num_matches] = rule_num; -! num_matches++; - } - - rule_num++; ---- 646,655 ---- - #ifdef LOG - printf ("rule #%d is true\n", rule_num); - #endif -! if(num_matches < MAX_RULEMATCHES - 1) -! matches[num_matches++] = rule_num; -! else -! printf("Ignoring matched asm rule %d, too many matched rules.\n", rule_num); - } - - rule_num++; -diff -rc MPlayer-1.0rc1-orig/stream/realrtsp/asmrp.h MPlayer-1.0rc1/stream/realrtsp/asmrp.h -*** MPlayer-1.0rc1-orig/stream/realrtsp/asmrp.h 2006-10-23 00:32:25.000000000 +0200 ---- MPlayer-1.0rc1/stream/realrtsp/asmrp.h 2007-01-14 19:11:06.000000000 +0100 -*************** -*** 40,45 **** ---- 40,47 ---- - #ifndef HAVE_ASMRP_H - #define HAVE_ASMRP_H - -+ #define MAX_RULEMATCHES 16 -+ - int asmrp_match (const char *rules, int bandwidth, int *matches) ; - - #endif -diff -rc MPlayer-1.0rc1-orig/stream/realrtsp/real.c MPlayer-1.0rc1/stream/realrtsp/real.c -*** MPlayer-1.0rc1-orig/stream/realrtsp/real.c 2006-10-23 00:32:25.000000000 +0200 ---- MPlayer-1.0rc1/stream/realrtsp/real.c 2007-01-14 19:11:06.000000000 +0100 -*************** -*** 271,277 **** - int j=0; - int n; - char b[64]; -! int rulematches[16]; - - #ifdef LOG - printf("calling asmrp_match with:\n%s\n%u\n", desc->stream[i]->asm_rule_book, bandwidth); ---- 271,277 ---- - int j=0; - int n; - char b[64]; -! int rulematches[MAX_RULEMATCHES]; - - #ifdef LOG - printf("calling asmrp_match with:\n%s\n%u\n", desc->stream[i]->asm_rule_book, bandwidth); diff --git a/pkgs/applications/video/MPlayer/default.nix b/pkgs/applications/video/MPlayer/default.nix index acc4ab59d970..9b3065ad08ab 100644 --- a/pkgs/applications/video/MPlayer/default.nix +++ b/pkgs/applications/video/MPlayer/default.nix @@ -1,8 +1,8 @@ { alsaSupport ? false, xvSupport ? true, theoraSupport ? false, cacaSupport ? false -, xineramaSupport ? false, randrSupport ? false +, xineramaSupport ? false, randrSupport ? false, dvdnavSupport ? true , stdenv, fetchurl, x11, freetype, freefont_ttf, zlib , alsa ? null, libX11, libXv ? null, libtheora ? null, libcaca ? null -, libXinerama ? null, libXrandr ? null +, libXinerama ? null, libXrandr ? null, libdvdnav ? null }: assert alsaSupport -> alsa != null; @@ -11,6 +11,7 @@ assert theoraSupport -> libtheora != null; assert cacaSupport -> libcaca != null; assert xineramaSupport -> libXinerama != null; assert randrSupport -> libXrandr != null; +assert dvdnavSupport -> libdvdnav != null; let @@ -21,11 +22,11 @@ let in stdenv.mkDerivation { - name = "MPlayer-1.0rc1try2"; + name = "MPlayer-1.0rc2"; src = fetchurl { - url = http://www1.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc1.tar.bz2; - sha1 = "a450c0b0749c343a8496ba7810363c9d46dfa73c"; + url = http://www1.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc2.tar.bz2; + sha1 = "e9b496f3527c552004ec6d01d6b43f196b43ce2d"; }; buildInputs = [ @@ -36,17 +37,22 @@ stdenv.mkDerivation { (if cacaSupport then libcaca else null) (if xineramaSupport then libXinerama else null) (if randrSupport then libXrandr else null) + (if dvdnavSupport then libdvdnav else null) ]; configureFlags = " ${if cacaSupport then "--enable-caca" else "--disable-caca"} - --with-win32libdir=${win32codecs} - --with-reallibdir=${win32codecs} + ${if dvdnavSupport then "--enable-dvdnav" else ""} + --win32codecsdir=${win32codecs} + --realcodecsdir=${win32codecs} --enable-runtime-cpudetection - --enable-x11 --with-x11libdir=/no-such-dir --with-extraincdir=${libX11}/include + --enable-x11 --with-extraincdir=${libX11}/include --disable-xanim "; + NIX_LDFLAGS = "-lX11 -lXext " # !!! hack, necessary to get libX11/Xext in the RPATH + + (if dvdnavSupport then "-ldvdnav" else ""); + # Provide a reasonable standard font. Maybe we should symlink here. postInstall = "cp ${freefont_ttf}/share/fonts/truetype/FreeSans.ttf $out/share/mplayer/subfont.ttf"; @@ -54,14 +60,12 @@ stdenv.mkDerivation { # These fix MPlayer's aspect ratio when run in a screen rotated with # Xrandr. # See: http://itdp.de/~itdp/html/mplayer-dev-eng/2005-08/msg00427.html - ./mplayer-aspect.patch - ./mplayer-pivot.patch - - # Security fix. - ./asmrules-fix.patch + #./mplayer-aspect.patch + #./mplayer-pivot.patch ]; meta = { description = "A movie player that supports many video formats"; + homepage = "GPL"; }; } diff --git a/pkgs/applications/video/MPlayer/mplayer-aspect.patch b/pkgs/applications/video/MPlayer/mplayer-aspect.patch deleted file mode 100644 index 7e7dedaa2bfa..000000000000 --- a/pkgs/applications/video/MPlayer/mplayer-aspect.patch +++ /dev/null @@ -1,96 +0,0 @@ -diff -rc MPlayer-1.0pre8-orig/libvo/aspect.c MPlayer-1.0pre8/libvo/aspect.c -*** MPlayer-1.0pre8-orig/libvo/aspect.c 2006-06-11 20:35:43.000000000 +0200 ---- MPlayer-1.0pre8/libvo/aspect.c 2006-07-10 18:55:11.000000000 +0200 -*************** -*** 11,16 **** ---- 11,19 ---- - #include - #endif - -+ int vo_physical_width = 0; -+ int vo_physical_height = 0; -+ - int vo_panscan_x = 0; - int vo_panscan_y = 0; - float vo_panscan_amount = 0; -*************** -*** 18,24 **** - - #include "video_out.h" - -! float monitor_aspect=4.0/3.0; - float monitor_pixel_aspect=0; - extern float movie_aspect; - ---- 21,27 ---- - - #include "video_out.h" - -! float monitor_aspect=-1.0f; - float monitor_pixel_aspect=0; - extern float movie_aspect; - -*************** -*** 48,53 **** ---- 51,68 ---- - aspdat.preh = preh; - } - -+ static void init_monitor_aspect( void ) -+ { -+ if (monitor_aspect != -1.0f) return; -+ if (vo_physical_width == 0 || vo_physical_height == 0) { -+ // if there's no other indication, assume square pixels -+ vo_physical_width = aspdat.scrw; -+ vo_physical_height = aspdat.scrh; -+ } -+ mp_msg(MSGT_VO,MSGL_V,"\naspect: monitor aspect detected %d:%d\n", vo_physical_width, vo_physical_height); -+ monitor_aspect = 1.0f * vo_physical_width / vo_physical_height; -+ } -+ - void aspect_save_screenres(int scrw, int scrh){ - #ifdef ASPECT_DEBUG - printf("aspect_save_screenres %dx%d \n",scrw,scrh); -*************** -*** 56,61 **** ---- 71,77 ---- - aspdat.scrh = scrh; - if (monitor_pixel_aspect) - monitor_aspect = monitor_pixel_aspect * scrw / scrh; -+ init_monitor_aspect(); // now is a good time - } - - /* aspect is called with the source resolution and the -diff -rc MPlayer-1.0pre8-orig/libvo/aspect.h MPlayer-1.0pre8/libvo/aspect.h -*** MPlayer-1.0pre8-orig/libvo/aspect.h 2006-06-11 20:35:43.000000000 +0200 ---- MPlayer-1.0pre8/libvo/aspect.h 2006-07-10 18:52:04.000000000 +0200 -*************** -*** 2,7 **** ---- 2,10 ---- - #define __ASPECT_H - /* Stuff for correct aspect scaling. */ - -+ extern int vo_physical_width; -+ extern int vo_physical_height; -+ - extern int vo_panscan_x; - extern int vo_panscan_y; - extern float vo_panscan_amount; -diff -rc MPlayer-1.0pre8-orig/libvo/x11_common.c MPlayer-1.0pre8/libvo/x11_common.c -*** MPlayer-1.0pre8-orig/libvo/x11_common.c 2006-06-11 20:35:43.000000000 +0200 ---- MPlayer-1.0pre8/libvo/x11_common.c 2006-07-10 18:52:04.000000000 +0200 -*************** -*** 463,468 **** ---- 463,474 ---- - if (!vo_screenheight) - vo_screenheight = DisplayHeight(mDisplay, mScreen); - } -+ if (vo_physical_width == 0) { -+ vo_physical_width = DisplayWidthMM(mDisplay, mScreen); -+ } -+ if (vo_physical_height == 0) { -+ vo_physical_height = DisplayHeightMM(mDisplay, mScreen); -+ } - // get color depth (from root window, or the best visual): - XGetWindowAttributes(mDisplay, mRootWin, &attribs); - depth = attribs.depth; diff --git a/pkgs/applications/video/MPlayer/mplayer-pivot.patch b/pkgs/applications/video/MPlayer/mplayer-pivot.patch deleted file mode 100644 index 33afa32a009a..000000000000 --- a/pkgs/applications/video/MPlayer/mplayer-pivot.patch +++ /dev/null @@ -1,112 +0,0 @@ ---- MPlayer/configure.orig 2005-08-21 23:47:47.000000000 +0200 -+++ MPlayer/configure 2005-08-21 23:55:02.000000000 +0200 -@@ -162,6 +162,7 @@ - --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect] - --enable-joystick enable joystick support [disable] - --disable-vm disable support X video mode extensions [autodetect] -+ --disable-randr disable support for X resize and rotate extension [autodetect] - --disable-xf86keysym disable support for 'multimedia' keys [autodetect] - --disable-tv disable TV Interface (tv/dvb grabbers) [enable] - --disable-tv-v4l disable Video4Linux TV Interface support [autodetect] -@@ -252,6 +253,7 @@ - --enable-xv build with Xv render support for X 4.x [autodetect] - --enable-xvmc build with XvMC acceleration for X 4.x [disable] - --enable-vm build with XF86VidMode support for X11 [autodetect] -+ --enable-randr build with XRandR support for X11 [autodetect] - --enable-xinerama build with Xinerama support for X11 [autodetect] - --enable-x11 build with X11 render support [autodetect] - --enable-fbdev build with FBDev render support [autodetect] -@@ -1351,6 +1353,7 @@ - _mga=auto - _xmga=auto - _vm=auto -+_randr=auto - _xf86keysym=auto - _mlib=auto - _sgiaudio=auto -@@ -1562,6 +1565,8 @@ - --disable-xmga) _xmga=no ;; - --enable-vm) _vm=yes ;; - --disable-vm) _vm=no ;; -+ --enable-randr) _randr=yes ;; -+ --disable-randr) _randr=no ;; - --enable-xf86keysym) _xf86keysym=yes ;; - --disable-xf86keysym) _xf86keysym=no ;; - --enable-mlib) _mlib=yes ;; -@@ -3603,6 +3608,25 @@ - fi - echores "$_vm" - -+# X Resize, Rotate and Reflect extension -+echocheck "Xrandr" -+if test "$_x11" = yes && test "$_randr" = auto; then -+ cat > $TMPC < -+#include -+int main(void) { (void) XRRQueryExtension(0, 0, 0); return 0; } -+EOF -+ _randr=no -+ cc_check $_inc_x11 -lXrandr $_ld_x11 && _randr=yes -+fi -+if test "$_randr" = yes ; then -+ _def_randr='#define HAVE_XRANDR 1' -+ _ld_randr='-lXrandr' -+else -+ _def_randr='#undef HAVE_XRANDR' -+fi -+echores "$_randr" -+ - # Check for the presence of special keycodes, like audio control buttons - # that XFree86 might have. Used to be bundled with the xf86vm check, but - # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT -@@ -6762,7 +6786,7 @@ - SLIBSUF=.so - - # video output --X_LIB = $_ld_gl $_ld_dga $_ld_xv $_ld_xvmc $_ld_vm $_ld_xinerama $_ld_x11 $_ld_sock -+X_LIB = $_ld_gl $_ld_dga $_ld_xv $_ld_xvmc $_ld_vm $_ld_randr $_ld_xinerama $_ld_x11 $_ld_sock - GGI_LIB = $_ld_ggi - MLIB_LIB = $_ld_mlib - MLIB_INC = $_inc_mlib -@@ -7465,6 +7489,7 @@ - $_def_xv - $_def_xvmc - $_def_vm -+$_def_randr - $_def_xf86keysym - $_def_xinerama - $_def_gl ---- MPlayer/libvo/x11_common.c.orig 2005-08-21 23:56:20.000000000 +0200 -+++ MPlayer/libvo/x11_common.c 2005-08-22 00:05:17.000000000 +0200 -@@ -39,6 +39,10 @@ - #include - #endif - -+#ifdef HAVE_XRANDR -+#include -+#endif -+ - #ifdef HAVE_XF86XK - #include - #endif -@@ -434,6 +438,20 @@ - int clock; - - XF86VidModeGetModeLine(mDisplay, mScreen, &clock, &modeline); -+#ifdef HAVE_XRANDR -+ { -+ Rotation current_rotation; -+ -+ XRRRotations(mDisplay, mScreen, ¤t_rotation); -+ if ((current_rotation&RR_Rotate_90) != 0 || -+ (current_rotation&RR_Rotate_270) != 0) { -+ unsigned short tmp; -+ tmp = modeline.hdisplay; -+ modeline.hdisplay = modeline.vdisplay; -+ modeline.vdisplay = tmp; -+ } -+ } -+#endif - if (!vo_screenwidth) - vo_screenwidth = modeline.hdisplay; - if (!vo_screenheight) diff --git a/pkgs/applications/video/MPlayer/win32codecs/default.nix b/pkgs/applications/video/MPlayer/win32codecs/default.nix index 8548954a6626..36de4cef857b 100644 --- a/pkgs/applications/video/MPlayer/win32codecs/default.nix +++ b/pkgs/applications/video/MPlayer/win32codecs/default.nix @@ -1,8 +1,8 @@ {stdenv, fetchurl}: stdenv.mkDerivation { - name = "MPlayer-codecs-essential-20061022"; + name = "MPlayer-codecs-essential-20071007"; builder = ./builder.sh; src = fetchurl { - url = http://www1.mplayerhq.hu/MPlayer/releases/codecs/essential-20061022.tar.bz2; - md5 = "abcf4a3abc16cf88c9df7e0a77e9b941"; + url = http://www2.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2; + sha256 = "18vls12n12rjw0mzw4pkp9vpcfmd1c21rzha19d7zil4hn7fs2ic"; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0046f2da09a3..385d3a0ac874 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3681,7 +3681,7 @@ rec { }; MPlayer = import ../applications/video/MPlayer { - inherit fetchurl stdenv freetype x11 zlib libtheora libcaca freefont_ttf; + inherit fetchurl stdenv freetype x11 zlib libtheora libcaca freefont_ttf libdvdnav; inherit (xlibs) libX11 libXv libXinerama libXrandr; alsaSupport = true; alsa = alsaLib;