--- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/rules +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/rules @@ -0,0 +1,212 @@ +#!/usr/bin/make -f +#-*- makefile -*- + +#export DH_VERBOSE=1 + +#include dpatch +include /usr/share/dpatch/dpatch.make + +DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) + +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +ifeq "$(DEB_BUILD_ARCH)" "i386" + CONFIGURE_ARCH = --enable-win32 --enable-dshow --with-win32libdir=/usr/lib/win32 --enable-real --with-reallibdir=/usr/lib/win32 + --enable-vidix --target=i586-linux +else +ifeq "$(DEB_BUILD_ARCH)" "powerpc" + CONFIGURE_ARCH = --enable-altivec --enable-vidix --enable-real --with-reallibdir=/usr/lib/win32 +else +ifeq "$(DEB_BUILD_ARCH)" "amd64" + CONFIGURE_ARCH = +endif +endif +endif + +CONFIGURE_PATH := --prefix=/usr --confdir=/etc/mplayer --mandir=/usr/share/man --datadir=/usr/share/mplayer --with-xanimlibdir=/usr/lib/xanim +CONFIGURE_COMMON := --enable-runtime-cpudetection --enable-largefiles +CONFIGURE_INPUT := --disable-mpdvdkit --enable-dvdread --enable-smb --enable-live --enable-ftp --enable-cdparanoia +CONFIGURE_CONTROL := --enable-lirc --enable-joystick --enable-xf86keysym +CONFIGURE_AUDIO_CODECS := --disable-external-faad --enable-vorbis --disable-internal-tremor --enable-mad --enable-liba52 --enable-libdts --enable-musepack --enable-faac --enable-speex +CONFIGURE_VIDEO_CODECS := --enable-xvid --enable-libavcodec --enable-libavformat --enable-theora --enable-libdv --enable-libmpeg2 --enable-tv-v4l --enable-tv-v4l2 --enable-x264 +CONFIGURE_AUDIO_OUT := --enable-alsa --enable-ossaudio --enable-esd --enable-arts +CONFIGURE_VIDEO_OUT := --enable-xinerama --enable-menu --enable-xv --enable-vm --enable-gl --enable-xmga --enable-mga --enable-3dfx --enable-tdfxfb --enable-sdl --enable-aa --enable-caca --enable-dxr3 --enable-xvmc --with-xvmclib=XvMCW --enable-ggi --enable-fbdev +CONFIGURE_MISC := --enable-freetype --enable-fontconfig --enable-gif --enable-png --enable-jpeg --enable-liblzo --enable-fribidi +CONFIGURE_ALL := $(CONFIGURE_ARCH) $(CONFIGURE_PATH) $(CONFIGURE_COMMON) $(CONFIGURE_INPUT) $(CONFIGURE_CONTROL) $(CONFIGURE_AUDIO_CODECS) $(CONFIGURE_VIDEO_CODECS) $(CONFIGURE_AUDIO_OUT) $(CONFIGURE_VIDEO_OUT) $(CONFIGURE_MISC) + + +modify-config: +ifeq "$(DEB_BUILD_ARCH)" "i386" + sed -i 's;#undef HAVE_3DNOW;#define HAVE_3DNOW 1;g' config.h + sed -i 's;#undef HAVE_3DNOWEX;#define HAVE_3DNOWEX 1;g' config.h + sed -i 's;#undef HAVE_MMX;#define HAVE_MMX 1;g' config.h + sed -i 's;#undef HAVE_MMX2;#define HAVE_MMX2 1;g' config.h + sed -i 's;#undef HAVE_SSE;#define HAVE_SSE 1;g' config.h + sed -i 's;#undef HAVE_SSE2;#define HAVE_SSE2 1;g' config.h + sed -i '/TARGET_MMX =/d' config.mak + echo 'TARGET_MMX = yes' >> config.mak + sed -i '/TARGET_MMX2 =/d' config.mak + echo 'TARGET_MMX2 = yes' >> config.mak + sed -i '/TARGET_SSE =/d' config.mak + echo 'TARGET_SSE = yes' >> config.mak + sed -i '/TARGET_SSE2 =/d' config.mak + echo 'TARGET_SSE2 = yes' >> config.mak + sed -i '/TARGET_3DNOW =/d' config.mak + echo 'TARGET_3DNOW = yes' >> config.mak + sed -i '/TARGET_3DNOWEX =/d' config.mak + echo 'TARGET_3DNOWEX = yes' >> config.mak +endif + +build: + +build-gui: build-gui-stamp +build-gui-stamp: patch + dh_testdir + if test -f build-nogui-stamp; then \ + $(MAKE) distclean; \ + rm -f build-nogui-stamp; \ + fi + ./configure $(CONFIGURE_ALL) --enable-gui --enable-mencoder + $(MAKE) -f debian/rules modify-config + $(MAKE) + touch build-gui-stamp + +build-nogui: build-nogui-stamp +build-nogui-stamp: patch + dh_testdir + if test -f build-gui-stamp; then \ + $(MAKE) distclean; \ + rm -f build-gui-stamp; \ + fi + ./configure $(CONFIGURE_ALL) --disable-gui --disable-mencoder + $(MAKE) -f debian/rules modify-config + $(MAKE) + touch build-nogui-stamp + +install: + dh_testdir + dh_testroot + dh_clean -k + $(MAKE) -f debian/rules install-gui + $(MAKE) -f debian/rules install-nogui + +install-gui: build-gui + dh_installdirs -pmplayer + $(MAKE) install DESTDIR=$(CURDIR)/debian/mplayer + + dh_link -pmplayer usr/bin/mplayer usr/bin/gmplayer + dh_link -pmplayer usr/share/man/man1/mplayer.1.gz usr/share/man/man1/gmplayer.1.gz + dh_link -pmplayer usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf usr/share/mplayer/subfont.ttf + cp etc/example.conf etc/mplayer.conf + dh_install -pmplayer etc/mplayer.conf etc/mplayer + rm -f etc/mplayer.conf + dh_install -pmplayer etc/codecs.conf etc/mplayer + dh_install -pmplayer etc/input.conf etc/mplayer + dh_install -pmplayer etc/menu.conf etc/mplayer + dh_installexamples -pmplayer -X.libdeps etc + dh_install -pmplayer + + #remove mencoder manpage link to prevent conflict with the mencoder package + rm debian/mplayer/usr/share/man/man1/mencoder.1 + + #split off mencoder package + mkdir -p debian/mencoder/usr/bin + mv debian/mplayer/usr/bin/mencoder debian/mencoder/usr/bin + mkdir -p debian/mencoder/usr/share/man/man1 + cp debian/mplayer/usr/share/man/man1/mplayer.1 debian/mencoder/usr/share/man/man1/mencoder.1 + +install-nogui: build-nogui + dh_installdirs -pmplayer-nogui + $(MAKE) install DESTDIR=$(CURDIR)/debian/mplayer-nogui + dh_link -pmplayer-nogui usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf usr/share/mplayer/subfont.ttf + cp etc/example.conf etc/mplayer.conf + dh_install -pmplayer-nogui etc/mplayer.conf etc/mplayer + rm -f etc/mplayer.conf + dh_install -pmplayer-nogui etc/codecs.conf etc/mplayer + dh_install -pmplayer-nogui etc/input.conf etc/mplayer + dh_install -pmplayer-nogui etc/menu.conf etc/mplayer + dh_installexamples -pmplayer-nogui -X.libdeps etc + dh_install -pmplayer-nogui + +clean:: unpatch + dh_testdir + dh_testroot + -$(MAKE) distclean + -rm -f build-nogui-stamp build-gui-stamp + -test -r /usr/share/misc/config.sub && \ + cp -f /usr/share/misc/config.sub config.sub + -test -r /usr/share/misc/config.guess && \ + cp -f /usr/share/misc/config.guess config.guess + dh_clean + +binary-indep: build install + dh_testdir + dh_testroot + dh_installdocs + dh_installdocs -pmplayer-doc Copyright DOCS/HTML DOCS/de DOCS/it DOCS/tech DOCS/zh + dh_installchangelogs + dh_compress + dh_link + dh_fixperms + dh_strip + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +binary-arch: DH_OPTIONS=-a +binary-arch: build install + dh_testdir + dh_testroot + dh_install + dh_installdocs -A Copyright + dh_installmenu + dh_installmime + dh_installman + dh_installchangelogs ChangeLog + dh_desktop + dh_compress + dh_link + dh_fixperms + dh_strip + dh_perl + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +#greatly inspired by the mplayer package of Dariush Pietrzak +UPVERSION := 1.0pre7try2 +DEBIANVERSION := 0.99+1.0pre7try2 +UPVERSIONNAME := MPlayer-$(UPVERSION) +UPVERSIONURL := http://www1.mplayerhq.hu/MPlayer/releases/$(UPVERSIONNAME).tar.bz2 +get-orig-source: + mkdir tmp + ### download file, or link it if available + if [ -r $(M).tar.bz2 ] ; then ln -s ../$(UPVERSIONNAME).tar.bz2 tmp/. ; else \ + cd tmp && wget $(UPVERSIONURL) ; fi + cd tmp && tar xjf $(UPVERSIONNAME).tar.bz2 && rm $(UPVERSIONAME).tar.bz2 + #according to the README, this file should be there + cp -v /usr/share/doc/libjpeg62/README.gz tmp/$(UPVERSIONNAME)/libavcodec/README.jfdct.gz + + # this contains the dreaded DeCSS code. We can live without, by + # using libdvdread3 (and the optional library installed by + # /usr/share/doc/libdvdread3/examples/install-css.sh :-) + cd tmp/$(UPVERSIONNAME) && rm -r libmpdvdkit2 + # Well this may seem a bit excessive... but this code is not useful + # for building the package, and most of it does not correctly state + # author-license-copyright : so I throw out the baby and the bath... + # When and if someone needs this stuff, I will carefully scrutinize + # it and add what is suitable + cd tmp/$(UPVERSIONNAME) && rm -r TOOLS + # move the upstream debian dir out of the way + cd tmp/$(UPVERSIONNAME) && mv debian debian_upstream + # ok lets repackage + cd tmp && mv $(UPVERSIONNAME) mplayer-$(DEBIANVERSION) && tar czf mplayer_$(DEBIANVERSION).orig.tar.gz mplayer-$(DEBIANVERSION) && mv mplayer_$(DEBIANVERSION).orig.tar.gz .. && rm -r mplayer-$(DEBIANVERSION) + rmdir tmp + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/control +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/control @@ -0,0 +1,321 @@ +Source: mplayer +Section: graphics +Priority: extra +Maintainer: Ubuntu MOTU Media Team +Uploaders: Sebastian Dröge +Standards-Version: 3.6.2 +Build-Depends: debhelper (>> 3), libncurses5-dev, libesd0-dev, liblircclient-dev, libgtk2.0-dev, libvorbis-dev, libsdl1.2-dev, libmad0-dev, sharutils, libasound2-dev (>= 1.0.1), liblzo-dev, gawk, libjpeg62-dev, libaudiofile-dev, libsmbclient-dev, libxv-dev, libpng3-dev, libungif4-dev, libcdparanoia0-dev, libxvidcore4-dev, libdv-dev, liblivemedia-dev (>= 2004.05.01), libfreetype6-dev, em8300-headers, libgl1-mesa-dev | libgl-dev, libdvdread-dev, libdts-dev, libtheora-dev, libglu1-mesa-dev | libglu-dev, libartsc0-dev, libfontconfig-dev, libxxf86dga-dev, libxinerama-dev, libxxf86vm-dev, liblame-dev, libxvmc-dev, libggi2-dev, ttf-bitstream-vera, libmpcdec-dev, libspeex-dev, libfribidi-dev, libfaac-dev, dpatch, sed (>= 4.0), libaa1-dev, libcaca-dev, libx264-dev + +Package: mplayer +Architecture: any +Depends: ${shlibs:Depends}, ttf-bitstream-vera, mplayer-skins +Suggests: w32codecs, libdvdcss, mplayer-doc +Conflicts: mplayer-custom, mplayer-nogui +Replaces: mplayer-386, mplayer-586, mplayer-686, mplayer-k6, mplayer-k7, mplayer-custom, mplayer-powerpc, mplayer-g4, mplayer-amd64, mplayer-nogui +Description: The Ultimate Movie Player For Linux + It plays most mpeg, avi and asf files, supported by many native and win32 + DLL codecs. You can watch VCD, DVD and even DivX movies too. The other + big feature of mplayer is the wide range of supported output drivers. It + works with X11, Xv, DGA, OpenGL, SVGAlib, fbdev, but you can use SDL (and + this way all drivers of SDL) and some lowlevel card-specific drivers (for + Matrox/3dfx/SiS) too! Most of them supports software or hardware scaling, + so you can enjoy movies in fullscreen. + . + This version includes the Gtk GUI + +Package: mplayer-nogui +Architecture: any +Depends: ${shlibs:Depends}, ttf-bitstream-vera +Suggests: w32codecs, libdvdcss, mplayer-doc +Conflicts: mplayer-386, mplayer-586, mplayer-686, mplayer-k6, mplayer-k7, mplayer-custom, mplayer-powerpc, mplayer-g4, mplayer-amd64, mplayer +Replaces: mplayer-386, mplayer-586, mplayer-686, mplayer-k6, mplayer-k7, mplayer-custom, mplayer-powerpc, mplayer-g4, mplayer-amd64, mplayer +Provides: mplayer +Description: The Ultimate Movie Player For Linux + It plays most mpeg, avi and asf files, supported by many native and win32 + DLL codecs. You can watch VCD, DVD and even DivX movies too. The other + big feature of mplayer is the wide range of supported output drivers. It + works with X11, Xv, DGA, OpenGL, SVGAlib, fbdev, but you can use SDL (and + this way all drivers of SDL) and some lowlevel card-specific drivers (for + Matrox/3dfx/SiS) too! Most of them supports software or hardware scaling, + so you can enjoy movies in fullscreen. + . + This version comes with no GUI + +Package: mencoder +Architecture: any +Depends: ${shlibs:Depends} +Suggests: w32codecs, libdvdcss, mplayer-doc +Conflicts: mencoder-custom +Replaces: mencoder-k6, mencoder-k7, mencoder-386, mencoder-586, mencoder-686, mencoder-powerpc, mencoder-g4, mencoder-amd64, mencoder-custom +Description: MPlayer's Movie Encoder + A simple movie encoder, designed to encode MPlayer-playable movies + (AVI/ASF/OGG/DVD/VCD/VOB/MPG/MOV/VIV/FLI/RM/NUV/NET) to other + MPlayer-playable formats. It can encode with various codecs, like DivX4 (1 + or 2 passes), libavcodec, PCM/MP3/VBRMP3 audio. Also has stream copying and + video resizing abilities. + +Package: mplayer-doc +Architecture: all +Description: The Ultimate Movie Player For Linux (Documentation) + It plays most mpeg, avi and asf files, supported by many native and win32 + DLL codecs. You can watch VCD, DVD and even DivX movies too. The other + big feature of mplayer is the wide range of supported output drivers. It + works with X11, Xv, DGA, OpenGL, SVGAlib, fbdev, but you can use SDL (and + this way all drivers of SDL) and some lowlevel card-specific drivers (for + Matrox/3dfx/SiS) too! Most of them supports software or hardware scaling, + so you can enjoy movies in fullscreen. + . + This package contains the documentation for mplayer/mencoder + +Package: mplayer-386 +Architecture: all +Depends: mplayer +Description: The Ultimate Movie Player For Linux (dummy package) + It plays most mpeg, avi and asf files, supported by many native and win32 + DLL codecs. You can watch VCD, DVD and even DivX movies too. The other + big feature of mplayer is the wide range of supported output drivers. It + works with X11, Xv, DGA, OpenGL, SVGAlib, fbdev, but you can use SDL (and + this way all drivers of SDL) and some lowlevel card-specific drivers (for + Matrox/3dfx/SiS) too! Most of them supports software or hardware scaling, + so you can enjoy movies in fullscreen. + . + This package is only a transitional dummy package which depends on the + real mplayer package + +Package: mplayer-586 +Architecture: all +Depends: mplayer +Description: The Ultimate Movie Player For Linux (dummy package) + It plays most mpeg, avi and asf files, supported by many native and win32 + DLL codecs. You can watch VCD, DVD and even DivX movies too. The other + big feature of mplayer is the wide range of supported output drivers. It + works with X11, Xv, DGA, OpenGL, SVGAlib, fbdev, but you can use SDL (and + this way all drivers of SDL) and some lowlevel card-specific drivers (for + Matrox/3dfx/SiS) too! Most of them supports software or hardware scaling, + so you can enjoy movies in fullscreen. + . + This package is only a transitional dummy package which depends on the + real mplayer package + +Package: mplayer-686 +Architecture: all +Depends: mplayer +Description: The Ultimate Movie Player For Linux (dummy package) + It plays most mpeg, avi and asf files, supported by many native and win32 + DLL codecs. You can watch VCD, DVD and even DivX movies too. The other + big feature of mplayer is the wide range of supported output drivers. It + works with X11, Xv, DGA, OpenGL, SVGAlib, fbdev, but you can use SDL (and + this way all drivers of SDL) and some lowlevel card-specific drivers (for + Matrox/3dfx/SiS) too! Most of them supports software or hardware scaling, + so you can enjoy movies in fullscreen. + . + This package is only a transitional dummy package which depends on the + real mplayer package + +Package: mplayer-k6 +Architecture: all +Depends: mplayer +Description: The Ultimate Movie Player For Linux (dummy package) + It plays most mpeg, avi and asf files, supported by many native and win32 + DLL codecs. You can watch VCD, DVD and even DivX movies too. The other + big feature of mplayer is the wide range of supported output drivers. It + works with X11, Xv, DGA, OpenGL, SVGAlib, fbdev, but you can use SDL (and + this way all drivers of SDL) and some lowlevel card-specific drivers (for + Matrox/3dfx/SiS) too! Most of them supports software or hardware scaling, + so you can enjoy movies in fullscreen. + . + This package is only a transitional dummy package which depends on the + real mplayer package + +Package: mplayer-k7 +Architecture: all +Depends: mplayer +Description: The Ultimate Movie Player For Linux (dummy package) + It plays most mpeg, avi and asf files, supported by many native and win32 + DLL codecs. You can watch VCD, DVD and even DivX movies too. The other + big feature of mplayer is the wide range of supported output drivers. It + works with X11, Xv, DGA, OpenGL, SVGAlib, fbdev, but you can use SDL (and + this way all drivers of SDL) and some lowlevel card-specific drivers (for + Matrox/3dfx/SiS) too! Most of them supports software or hardware scaling, + so you can enjoy movies in fullscreen. + . + This package is only a transitional dummy package which depends on the + real mplayer package + +Package: mplayer-custom +Architecture: all +Depends: mplayer +Description: The Ultimate Movie Player For Linux (dummy package) + It plays most mpeg, avi and asf files, supported by many native and win32 + DLL codecs. You can watch VCD, DVD and even DivX movies too. The other + big feature of mplayer is the wide range of supported output drivers. It + works with X11, Xv, DGA, OpenGL, SVGAlib, fbdev, but you can use SDL (and + this way all drivers of SDL) and some lowlevel card-specific drivers (for + Matrox/3dfx/SiS) too! Most of them supports software or hardware scaling, + so you can enjoy movies in fullscreen. + . + This package is only a transitional dummy package which depends on the + real mplayer package + +Package: mplayer-powerpc +Architecture: all +Depends: mplayer +Description: The Ultimate Movie Player For Linux (dummy package) + It plays most mpeg, avi and asf files, supported by many native and win32 + DLL codecs. You can watch VCD, DVD and even DivX movies too. The other + big feature of mplayer is the wide range of supported output drivers. It + works with X11, Xv, DGA, OpenGL, SVGAlib, fbdev, but you can use SDL (and + this way all drivers of SDL) and some lowlevel card-specific drivers (for + Matrox/3dfx/SiS) too! Most of them supports software or hardware scaling, + so you can enjoy movies in fullscreen. + . + This package is only a transitional dummy package which depends on the + real mplayer package + +Package: mplayer-g4 +Architecture: all +Depends: mplayer +Description: The Ultimate Movie Player For Linux (dummy package) + It plays most mpeg, avi and asf files, supported by many native and win32 + DLL codecs. You can watch VCD, DVD and even DivX movies too. The other + big feature of mplayer is the wide range of supported output drivers. It + works with X11, Xv, DGA, OpenGL, SVGAlib, fbdev, but you can use SDL (and + this way all drivers of SDL) and some lowlevel card-specific drivers (for + Matrox/3dfx/SiS) too! Most of them supports software or hardware scaling, + so you can enjoy movies in fullscreen. + . + This package is only a transitional dummy package which depends on the + real mplayer package + +Package: mplayer-amd64 +Architecture: all +Depends: mplayer +Description: The Ultimate Movie Player For Linux (dummy package) + It plays most mpeg, avi and asf files, supported by many native and win32 + DLL codecs. You can watch VCD, DVD and even DivX movies too. The other + big feature of mplayer is the wide range of supported output drivers. It + works with X11, Xv, DGA, OpenGL, SVGAlib, fbdev, but you can use SDL (and + this way all drivers of SDL) and some lowlevel card-specific drivers (for + Matrox/3dfx/SiS) too! Most of them supports software or hardware scaling, + so you can enjoy movies in fullscreen. + . + This package is only a transitional dummy package which depends on the + real mplayer package + +Package: mencoder-k6 +Architecture: all +Depends: mencoder +Description: MPlayer's Movie Encoder (dummy package) + A simple movie encoder, designed to encode MPlayer-playable movies + (AVI/ASF/OGG/DVD/VCD/VOB/MPG/MOV/VIV/FLI/RM/NUV/NET) to other + MPlayer-playable formats. It can encode with various codecs, like DivX4 (1 + or 2 passes), libavcodec, PCM/MP3/VBRMP3 audio. Also has stream copying and + video resizing abilities. + . + This package is only a transitional dummy package which depends on the + real mencoder package + +Package: mencoder-k7 +Architecture: all +Depends: mencoder +Description: MPlayer's Movie Encoder (dummy package) + A simple movie encoder, designed to encode MPlayer-playable movies + (AVI/ASF/OGG/DVD/VCD/VOB/MPG/MOV/VIV/FLI/RM/NUV/NET) to other + MPlayer-playable formats. It can encode with various codecs, like DivX4 (1 + or 2 passes), libavcodec, PCM/MP3/VBRMP3 audio. Also has stream copying and + video resizing abilities. + . + This package is only a transitional dummy package which depends on the + real mencoder package + +Package: mencoder-386 +Architecture: all +Depends: mencoder +Description: MPlayer's Movie Encoder (dummy package) + A simple movie encoder, designed to encode MPlayer-playable movies + (AVI/ASF/OGG/DVD/VCD/VOB/MPG/MOV/VIV/FLI/RM/NUV/NET) to other + MPlayer-playable formats. It can encode with various codecs, like DivX4 (1 + or 2 passes), libavcodec, PCM/MP3/VBRMP3 audio. Also has stream copying and + video resizing abilities. + . + This package is only a transitional dummy package which depends on the + real mencoder package + +Package: mencoder-586 +Architecture: all +Depends: mencoder +Description: MPlayer's Movie Encoder (dummy package) + A simple movie encoder, designed to encode MPlayer-playable movies + (AVI/ASF/OGG/DVD/VCD/VOB/MPG/MOV/VIV/FLI/RM/NUV/NET) to other + MPlayer-playable formats. It can encode with various codecs, like DivX4 (1 + or 2 passes), libavcodec, PCM/MP3/VBRMP3 audio. Also has stream copying and + video resizing abilities. + . + This package is only a transitional dummy package which depends on the + real mencoder package + +Package: mencoder-686 +Architecture: all +Depends: mencoder +Description: MPlayer's Movie Encoder (dummy package) + A simple movie encoder, designed to encode MPlayer-playable movies + (AVI/ASF/OGG/DVD/VCD/VOB/MPG/MOV/VIV/FLI/RM/NUV/NET) to other + MPlayer-playable formats. It can encode with various codecs, like DivX4 (1 + or 2 passes), libavcodec, PCM/MP3/VBRMP3 audio. Also has stream copying and + video resizing abilities. + . + This package is only a transitional dummy package which depends on the + real mencoder package + +Package: mencoder-powerpc +Architecture: all +Depends: mencoder +Description: MPlayer's Movie Encoder (dummy package) + A simple movie encoder, designed to encode MPlayer-playable movies + (AVI/ASF/OGG/DVD/VCD/VOB/MPG/MOV/VIV/FLI/RM/NUV/NET) to other + MPlayer-playable formats. It can encode with various codecs, like DivX4 (1 + or 2 passes), libavcodec, PCM/MP3/VBRMP3 audio. Also has stream copying and + video resizing abilities. + . + This package is only a transitional dummy package which depends on the + real mencoder package + +Package: mencoder-g4 +Architecture: all +Depends: mencoder +Description: MPlayer's Movie Encoder (dummy package) + A simple movie encoder, designed to encode MPlayer-playable movies + (AVI/ASF/OGG/DVD/VCD/VOB/MPG/MOV/VIV/FLI/RM/NUV/NET) to other + MPlayer-playable formats. It can encode with various codecs, like DivX4 (1 + or 2 passes), libavcodec, PCM/MP3/VBRMP3 audio. Also has stream copying and + video resizing abilities. + . + This package is only a transitional dummy package which depends on the + real mencoder package + +Package: mencoder-amd64 +Architecture: all +Depends: mencoder +Description: MPlayer's Movie Encoder (dummy package) + A simple movie encoder, designed to encode MPlayer-playable movies + (AVI/ASF/OGG/DVD/VCD/VOB/MPG/MOV/VIV/FLI/RM/NUV/NET) to other + MPlayer-playable formats. It can encode with various codecs, like DivX4 (1 + or 2 passes), libavcodec, PCM/MP3/VBRMP3 audio. Also has stream copying and + video resizing abilities. + . + This package is only a transitional dummy package which depends on the + real mencoder package + +Package: mencoder-custom +Architecture: all +Depends: mencoder +Description: MPlayer's Movie Encoder (dummy package) + A simple movie encoder, designed to encode MPlayer-playable movies + (AVI/ASF/OGG/DVD/VCD/VOB/MPG/MOV/VIV/FLI/RM/NUV/NET) to other + MPlayer-playable formats. It can encode with various codecs, like DivX4 (1 + or 2 passes), libavcodec, PCM/MP3/VBRMP3 audio. Also has stream copying and + video resizing abilities. + . + This package is only a transitional dummy package which depends on the + real mencoder package + --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/changelog +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/changelog @@ -0,0 +1,177 @@ +mplayer (2:0.99+1.0pre7try2+cvs20060117-0ubuntu8.3) dapper-security; urgency=low + + * SECURITY UPDATE: Multiple integer underflows in MPlayer 1.0_rc2 and + earlier allow remote attackers to cause a denial of service + (process termination) and possibly execute arbitrary code via a + crafted video file that causes the stream_read function to read or + write arbitrary memory (LP: #279030) + - debian/patches/69_CVE-2008-3827.dpatch: Address various integer + underflows. Patch from oCert.org. + - http://www.ocert.org/advisories/ocert-2008-013.html + - CVE-2008-3827 + * SECURITY UPDATE: Uncontrolled array index in the sdpplin_parse function in + stream/realrtsp/sdpplin.c in MPlayer 1.0 rc2 allows remote attackers to + overwrite memory and execute arbitrary code via a large streamid SDP + parameter. (LP: #212601). + - debian/patches/68_CVE-2008-1558.dpatch: Properly check the stream ID. + Patch from upstream. + - CVE-2008-1558 + + -- Stefan Lesicnik Fri, 10 Oct 2008 22:23:45 +0200 + +mplayer (2:0.99+1.0pre7try2+cvs20060117-0ubuntu8.2) dapper-security; urgency=low + + * SECURITY UPDATE: buffer overruns in RMMF, CDDB, MOV demuxer, and URL + parser. (LP: #191488) + * debian/patches/{64_CVE-2008-0225_0238,65_CVE-2008-0485,66_CVE-2008-0629, + 67_CVE-2008-0630}.dpatch: Patches from upstream. + * References: + - CVE-2008-0225 + - CVE-2008-0238 + - CVE-2008-0485 + - CVE-2008-0629 + - CVE-2008-0630 + + -- William Grant Sun, 09 Mar 2008 12:23:46 +1100 + +mplayer (2:0.99+1.0pre7try2+cvs20060117-0ubuntu8.1) dapper-security; urgency=low + + * SECURITY UPDATE: buffer overruns in CDDB (LP: #118855), DMO decoder + (LP: #92968), RTSP handler (LP: #163291) and ASF decoder (LP: #163293). + * debian/patches/61_CVE-2006-1502.dpatch: Ensure that ASF index chunks are + of a sane size. Patch from Mandriva. + * debian/patches/62_CVE-2006-6172.dpatch: Don't match too many ASM rules, + lest we overrun the buffers. Patch provided by upstream. + * debian/patches/60_CVE-2007-1246.dpatch: Avoid buffer overrun in DMO + decoder. Patch from upstream SVN. + * debian/patches/63_CVE-2007-2948.dpatch: Don't take strings of unlimited + length from CDDB input. Patch from upstream SVN. + * References + CVE-2006-1502 + CVE-2006-6172 + CVE-2007-1246 + CVE-2007-2948 + + -- William Grant Sun, 02 Dec 2007 22:10:39 +1100 + +mplayer (2:0.99+1.0pre7try2+cvs20060117-0ubuntu8) dapper; urgency=low + + * 07_hig-compliant-desktop-file.dpatch: + - Use a more HIG compliant name for mplayer in the .desktop file. + Thanks to Matthew East for the patch (Ubuntu: #38205) + * 08_nsv-support.dpatch: + - Add support for specific NSV files. Thanks to Dana Olson for the patch. + (Ubuntu: #44831) + + -- Sebastian Dröge Mon, 15 May 2006 22:22:34 +0200 + +mplayer (2:0.99+1.0pre7try2+cvs20060117-0ubuntu7) dapper; urgency=low + + * debian/patches/06_close_gracefully.dpatch: + + Close gracefully when closing the mplayer window (Ubuntu: #38737) + + -- Sebastian Dröge Wed, 10 May 2006 16:04:56 +0200 + +mplayer (2:0.99+1.0pre7try2+cvs20060117-0ubuntu6) dapper; urgency=low + + * add libx264-dev to builddeps and activate that in debian rules + Thanks to Yagisan (Closes: M#31519) + * disable external faad (Closes: M#33828) + * add some of the script which upstream distributs in TOOLS/ to + /usr/share/doc/mplayer/examples. Please report bugs if you want + additional scripts added there. + + -- Reinhard Tartler Sat, 25 Mar 2006 19:14:02 +0100 + +mplayer (2:0.99+1.0pre7try2+cvs20060117-0ubuntu5) dapper; urgency=low + + * [SECURITY]: Fix heap overflow in libmpdemux/demuxer.h. Patch + retrieved from upstream CVS courtesy of Dennis Kaarsemaker. + * References + - CVE-2006-0579 + - http://bugs.gentoo.org/show_bug.cgi?id=122029 + + -- Daniel T Chen Sat, 25 Feb 2006 23:19:46 -0800 + +mplayer (2:0.99+1.0pre7try2+cvs20060117-0ubuntu4) dapper; urgency=low + + * added 05_gnome-screensaver-handling.dpatch to add support for + gnome-screensaver to the -stop-xscreensaver option + + -- Oliver Grawert Sat, 25 Feb 2006 20:52:36 +0100 + +mplayer (2:0.99+1.0pre7try2+cvs20060117-0ubuntu3) dapper; urgency=low + + * Add support for real codecs on powerpc (Closes Malone: #29190) + + -- Sebastian Dröge Sat, 18 Feb 2006 11:05:18 +0100 + +mplayer (2:0.99+1.0pre7try2+cvs20060117-0ubuntu2) dapper; urgency=low + + * enable libaa and libcaca support + - enable in debian/rules + - fix configure to link mplayer with -laa (update 03_fix-linking.dpatch) + + -- Reinhard Tartler Tue, 24 Jan 2006 01:31:46 +0100 + +mplayer (2:0.99+1.0pre7try2+cvs20060117-0ubuntu1) dapper; urgency=low + + * New CVS snapshot + * Improved Ubuntu branding by using the version from the changelog instead + of the default "dev-CVS--Ubuntu-4.0.3" + + -- Sebastian Dröge Tue, 17 Jan 2006 08:21:48 +0100 + +mplayer (2:0.99+1.0pre7try2+cvs20051205-0ubuntu7) dapper; urgency=low + + * Revert last change... I see no way how win32 support could ever work with + a 64bit binary on amd64 but when someone has a patch to enable it please + send it to me + + -- Sebastian Dröge Fri, 9 Dec 2005 17:50:36 +0100 + +mplayer (2:0.99+1.0pre7try2+cvs20051205-0ubuntu6) dapper; urgency=low + + * Enable win32 support for amd64 (thanks fabbione) :) + + -- Sebastian Dröge Thu, 8 Dec 2005 23:04:07 +0100 + +mplayer (2:0.99+1.0pre7try2+cvs20051205-0ubuntu5) dapper; urgency=low + + * Don't install the mencoder manpage in the mplayer package to prevent a + conflict + + -- Sebastian Dröge Thu, 8 Dec 2005 19:35:18 +0100 + +mplayer (2:0.99+1.0pre7try2+cvs20051205-0ubuntu4) dapper; urgency=low + + * Don't install .libdeps in examples + * Install {input,codecs,menu}.conf to /etc/mplayer where we had them before + + -- Sebastian Dröge Thu, 8 Dec 2005 19:15:39 +0100 + +mplayer (2:0.99+1.0pre7try2+cvs20051205-0ubuntu3) dapper; urgency=low + + * Stop having mplayer conflict with the mplayer-$arch transitional + packages, so the transition can actually happen correctly. + + -- Adam Conrad Thu, 8 Dec 2005 15:43:58 +1100 + +mplayer (2:0.99+1.0pre7try2+cvs20051205-0ubuntu2) dapper; urgency=low + + * Add dummy packages for the mplayer-$arch packages we had before + * Patch away the CPU runtime detection warning + + -- Sebastian Dröge Wed, 7 Dec 2005 15:39:24 +0100 + +mplayer (2:0.99+1.0pre7try2+cvs20051205-0ubuntu1) dapper; urgency=low + + * Initial release. + * Completly repackaged + * Based on ffmpeg/mplayer CVS 2005-12-05 + * debian/patches/01_configure.dpatch: fixes live.com bulding. + the patch is taken from Marillat's mplayer package + * debian/patches/02_mplayer.conf.dpatch: use a better suited config for + ubuntu + + -- Sebastian Dröge Wed, 05 Dec 2005 14:43:37 +0100 --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/copyright +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/copyright @@ -0,0 +1,28 @@ +This package was debianized by Sebastian Dröge +Thu, 01 Dec 2005 20:40:19 +0100. + +It was downloaded from http://www.mplayerhq.hu + +Copyright Holders: + MPlayer is copyrighted by various authors. + They are all listed in the 'Copyright' file + +License: + + mplayer is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + mplayer is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/mplayer.examples +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/mplayer.examples @@ -0,0 +1 @@ +TOOLS/* --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/compat +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/compat @@ -0,0 +1 @@ +4 --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/patches/00list +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/patches/00list @@ -0,0 +1,19 @@ +01_configure.dpatch +02_mplayer.conf.dpatch +03_fix-linking.dpatch +04_ubuntu-branding.dpatch +05_gnome-screensaver-handling.dpatch +57_demuxer_heap_overflow +06_close_gracefully.dpatch +07_hig-compliant-desktop-file.dpatch +08_nsv-support.dpatch +60_CVE-2007-1246.dpatch +61_CVE-2006-1502.dpatch +62_CVE-2006-6172.dpatch +63_CVE-2007-2948.dpatch +64_CVE-2008-0225_0238.dpatch +65_CVE-2008-0485.dpatch +66_CVE-2008-0629.dpatch +67_CVE-2008-0630.dpatch +68_CVE-2008-1558.dpatch +69_CVE-2008-3827.dpatch --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/patches/67_CVE-2008-0630.dpatch +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/patches/67_CVE-2008-0630.dpatch @@ -0,0 +1,18 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 67_CVE-2008-0630.dpatch by William Grant +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix CVE-2008-0630. + +@DPATCH@ +diff -urNad mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/url.c mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/url.c +--- mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/url.c 2005-11-27 02:57:39.000000000 +1100 ++++ mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/url.c 2008-03-09 12:21:16.000000000 +1100 +@@ -295,6 +295,7 @@ + } + } + ++ tmp = NULL; + while(i < len) { + // look for the next char that must be kept + for (j=i;j +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/cddb.c mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/cddb.c +--- mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/cddb.c 2005-11-25 13:06:47.000000000 +1100 ++++ mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/cddb.c 2007-12-02 22:09:19.000000000 +1100 +@@ -435,7 +435,7 @@ + + switch(status) { + case 210: +- ret = sscanf( http_hdr->body, "%d %s %08lx", &status, category, &disc_id); ++ ret = sscanf( http_hdr->body, "%d %99s %08lx", &status, category, &disc_id); + if( ret!=3 ) { + mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_ParseError); + return -1; +@@ -496,7 +496,7 @@ + ptr++; + // We have a list of exact/inexact matches, so which one do we use? + // So let's take the first one. +- ret = sscanf(ptr, "%s %08lx %s", cddb_data->category, &(cddb_data->disc_id), album_title); ++ ret = sscanf(ptr, "%99s %08lx %99s", cddb_data->category, &(cddb_data->disc_id), album_title); + if( ret!=3 ) { + mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_ParseError); + return -1; +@@ -533,7 +533,7 @@ + switch(status) { + case 200: + // Found exact match +- ret = sscanf(http_hdr->body, "%d %s %08lx %s", &status, cddb_data->category, &(cddb_data->disc_id), album_title); ++ ret = sscanf(http_hdr->body, "%d %99s %08lx %99s", &status, cddb_data->category, &(cddb_data->disc_id), album_title); + if( ret!=4 ) { + mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_ParseError); + return -1; --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/patches/61_CVE-2006-1502.dpatch +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/patches/61_CVE-2006-1502.dpatch @@ -0,0 +1,79 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 61_CVE-2006-1502.dpatch by William Grant +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/asfheader.c mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/asfheader.c +--- mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/asfheader.c 2005-11-01 10:37:41.000000000 +1100 ++++ mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/asfheader.c 2007-12-02 21:59:20.000000000 +1100 +@@ -187,7 +187,7 @@ + while ((pos = find_asf_guid(hdr, asf_stream_header_guid, pos, hdr_len)) >= 0) + { + ASF_stream_header_t *streamh = (ASF_stream_header_t *)&hdr[pos]; +- char *buffer; ++ uint8_t *buffer; + pos += sizeof(ASF_stream_header_t); + if (pos > hdr_len) goto len_err_out; + le2me_ASF_stream_header_t(streamh); +@@ -220,7 +220,9 @@ + asf_scrambling_h=buffer[0]; + asf_scrambling_w=(buffer[2]<<8)|buffer[1]; + asf_scrambling_b=(buffer[4]<<8)|buffer[3]; +- asf_scrambling_w/=asf_scrambling_b; ++ if(asf_scrambling_b>0){ ++ asf_scrambling_w/=asf_scrambling_b; ++ } + } else { + asf_scrambling_b=asf_scrambling_h=asf_scrambling_w=1; + } +diff -urNad mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/aviheader.c mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/aviheader.c +--- mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/aviheader.c 2006-01-13 07:04:34.000000000 +1100 ++++ mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/aviheader.c 2007-12-02 21:59:20.000000000 +1100 +@@ -206,8 +206,10 @@ + break; } + case mmioFOURCC('i', 'n', 'd', 'x'): { + uint32_t i; +- unsigned msize = 0; + avisuperindex_chunk *s; ++ if(chunksize<=24){ ++ break; ++ } + priv->suidx_size++; + priv->suidx = realloc(priv->suidx, priv->suidx_size * sizeof (avisuperindex_chunk)); + s = &priv->suidx[priv->suidx_size-1]; +@@ -225,12 +227,19 @@ + + print_avisuperindex_chunk(s); + +- msize = sizeof (uint32_t) * s->wLongsPerEntry * s->nEntriesInUse; +- s->aIndex = malloc(msize); +- memset (s->aIndex, 0, msize); +- s->stdidx = malloc (s->nEntriesInUse * sizeof (avistdindex_chunk)); +- memset (s->stdidx, 0, s->nEntriesInUse * sizeof (avistdindex_chunk)); ++ if( ((chunksize/4)/s->wLongsPerEntry) < s->nEntriesInUse){ ++ mp_msg (MSGT_HEADER, MSGL_WARN, "Broken super index chunk\n"); ++ s->nEntriesInUse = (chunksize/4)/s->wLongsPerEntry; ++ } + ++ // Check and fix this useless crap ++ if(s->wLongsPerEntry != sizeof (avisuperindex_entry)/4) { ++ mp_msg (MSGT_HEADER, MSGL_WARN, "Broken super index chunk size: %u\n",s->wLongsPerEntry); ++ s->wLongsPerEntry = sizeof(avisuperindex_entry)/4; ++ } ++ s->aIndex = calloc(s->nEntriesInUse, sizeof (avisuperindex_entry)); ++ s->stdidx = calloc(s->nEntriesInUse, sizeof (avistdindex_chunk)); ++ + // now the real index of indices + for (i=0; inEntriesInUse; i++) { + chunksize-=16; +@@ -636,6 +645,8 @@ + + c=stream_read_dword(demuxer->stream); + ++ if(!len) idx->dwFlags&=~AVIIF_KEYFRAME; ++ + // Fix keyframes for DivX files: + if(idxfix_divx) + if(avi_stream_id(id)==idxfix_videostream){ --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/patches/04_ubuntu-branding.dpatch +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/patches/04_ubuntu-branding.dpatch @@ -0,0 +1,40 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run + +@DPATCH@ + +--- mplayer/version.sh.old 2006-01-17 08:27:37.660764208 +0100 ++++ mplayer/version.sh 2006-01-17 08:28:45.010525488 +0100 +@@ -1,32 +1,3 @@ + #!/bin/sh + +-OS=`uname -s` +-case "$OS" in +- CYGWIN*|Linux|MINGW*) +- last_cvs_update=`date -r CVS/Entries +%y%m%d-%H:%M 2>/dev/null` +- ;; +- Darwin|*BSD*) +- # BSD 'date -r' does not print modification time +- # LC_ALL=C sets month/day order and English language in the date string +- # The if in the awk call works around wrong day/month order. +- last_cvs_update=`LC_ALL=C ls -lT CVS/Entries | \ +- awk '{ \ +- day=$7; \ +- month=index(" JanFebMarAprMayJunJulAugSepOctNovDec", $6); \ +- if(month==0) { \ +- day=$6; \ +- month=index(" JanFebMarAprMayJunJulAugSepOctNovDec",$7); } \ +- printf("%s%.02d%.02d-%s", \ +- substr($9, 3, 2), (month+1)/3, day, substr($8, 0, 5)); \ +- }'` +- ;; +- *) +- last_cvs_update=`date +%y%m%d-%H:%M` +- ;; +-esac +- +-extra="" +-if test "$1" ; then +- extra="-$1" +-fi +-echo "#define VERSION \"dev-CVS-${last_cvs_update}${extra}\"" >version.h ++echo "#define VERSION \"`dpkg-parsechangelog | grep ^Version: | cut -d' ' -f 2`\"" >version.h --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/patches/66_CVE-2008-0629.dpatch +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/patches/66_CVE-2008-0629.dpatch @@ -0,0 +1,42 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 66_CVE-2008-0629.dpatch by William Grant +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix CVE-2008-0629. + +@DPATCH@ +diff -urNad mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/cddb.c mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/cddb.c +--- mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/cddb.c 2005-11-25 13:06:47.000000000 +1100 ++++ mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/cddb.c 2008-03-09 12:20:34.000000000 +1100 +@@ -54,6 +54,9 @@ + #include "stream.h" + #include "network.h" + ++#define FFMAX(a,b) ((a) > (b) ? (a) : (b)) ++#define FFMIN(a,b) ((a) > (b) ? (b) : (a)) ++ + #define DEFAULT_FREEDB_SERVER "freedb.freedb.org" + #define DEFAULT_CACHE_DIR "/.cddb/" + +@@ -511,8 +514,9 @@ + } else { + len = ptr2-ptr+1; + } ++ len = FFMIN(sizeof(album_title) - 1, len); + strncpy(album_title, ptr, len); +- album_title[len-2]='\0'; ++ album_title[len]='\0'; + } + mp_msg(MSGT_DEMUX, MSGL_STATUS, MSGTR_MPDEMUX_CDDB_ParseOKFoundAlbumTitle, album_title); + return 0; +@@ -548,8 +552,9 @@ + } else { + len = ptr2-ptr+1; + } ++ len = FFMIN(sizeof(album_title) - 1, len); + strncpy(album_title, ptr, len); +- album_title[len-2]='\0'; ++ album_title[len]='\0'; + } + mp_msg(MSGT_DEMUX, MSGL_STATUS, MSGTR_MPDEMUX_CDDB_ParseOKFoundAlbumTitle, album_title); + return cddb_request_titles(cddb_data); --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/patches/07_hig-compliant-desktop-file.dpatch +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/patches/07_hig-compliant-desktop-file.dpatch @@ -0,0 +1,17 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run + +@DPATCH@ + +--- mplayer-0.99+1.0pre7try2+cvs20060117/etc/mplayer.desktop 2005-09-23 21:11:39.000000000 +0100 ++++ mplayer-matt/etc/mplayer.desktop 2006-04-05 17:01:55.000000000 +0100 +@@ -1,7 +1,7 @@ + [Desktop Entry] + Type=Application + Encoding=UTF-8 +-Name=MPlayer ++Name=MPlayer Movie Player + GenericName=Multimedia player + Comment=Multimedia player + Comment[de]=Multimedia-Player +Only in mplayer-matt/etc: mplayer.desktop~ + --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/patches/01_configure.dpatch +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/patches/01_configure.dpatch @@ -0,0 +1,31 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run + +@DPATCH@ + +--- mplayer/configure.orig 2005-04-02 13:56:19.000000000 +0200 ++++ mplayer/configure 2005-04-02 14:00:14.000000000 +0200 +@@ -5896,15 +5896,15 @@ + _def_live='#define STREAMING_LIVE555 1' + _live_libs_def="# LIVE555 Streaming Media libraries: + LIVE_LIB_DIR = $_livelibdir +-LIVE_LIBS = \$(LIVE_LIB_DIR)/liveMedia/libliveMedia.a +-LIVE_LIBS += \$(LIVE_LIB_DIR)/groupsock/libgroupsock.a +-LIVE_LIBS += \$(LIVE_LIB_DIR)/UsageEnvironment/libUsageEnvironment.a +-LIVE_LIBS += \$(LIVE_LIB_DIR)/BasicUsageEnvironment/libBasicUsageEnvironment.a ++LIVE_LIBS = /usr/lib/libliveMedia.a ++LIVE_LIBS += /usr/lib/libgroupsock.a ++LIVE_LIBS += /usr/lib/libUsageEnvironment.a ++LIVE_LIBS += /usr/lib/libBasicUsageEnvironment.a + LIVE_LIBS += -lstdc++ +-LIVE_INCLUDES = -I\$(LIVE_LIB_DIR)/liveMedia/include +-LIVE_INCLUDES += -I\$(LIVE_LIB_DIR)/UsageEnvironment/include +-LIVE_INCLUDES += -I\$(LIVE_LIB_DIR)/BasicUsageEnvironment/include +-LIVE_INCLUDES += -I\$(LIVE_LIB_DIR)/groupsock/include" ++LIVE_INCLUDES = -I/usr/include/liveMedia ++LIVE_INCLUDES += -I/usr/include/UsageEnvironment ++LIVE_INCLUDES += -I/usr/include/BasicUsageEnvironment ++LIVE_INCLUDES += -I/usr/include/groupsock" + _ld_live='$(LIVE_LIBS)' + _inputmodules="live555 $_inputmodules" + elif test "$_live_dist" = yes && test "$_network" = yes ; then + --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/patches/69_CVE-2008-3827.dpatch +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/patches/69_CVE-2008-3827.dpatch @@ -0,0 +1,33 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 69_CVE-2008-3827.dpatch by Stefan Lesicnik +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix CVE-2008-3827. + +@DPATCH@ +--- libmpdemux/demux_real.c 2007-02-03 03:16:07 +0000 ++++ mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/demux_real.c 2008-10-08 13:27:55 +0000 +@@ -953,6 +953,7 @@ + // last fragment! + if(dp_hdr->len!=vpkg_length-vpkg_offset) + mp_msg(MSGT_DEMUX,MSGL_V,"warning! assembled.len=%d frag.len=%d total.len=%d \n",dp->len,vpkg_offset,vpkg_length-vpkg_offset); ++ if (vpkg_offset > dp->len - sizeof(dp_hdr_t) - dp_hdr->len) vpkg_offset = dp->len - sizeof(dp_hdr_t) - dp_hdr->len; + stream_read(demuxer->stream, dp_data+dp_hdr->len, vpkg_offset); + if((dp_data[dp_hdr->len]&0x20) && (sh_video->format==0x30335652)) --dp_hdr->chunks; else + dp_hdr->len+=vpkg_offset; +@@ -975,6 +976,7 @@ + // non-last fragment: + if(dp_hdr->len!=vpkg_offset) + mp_msg(MSGT_DEMUX,MSGL_V,"warning! assembled.len=%d offset=%d frag.len=%d total.len=%d \n",dp->len,vpkg_offset,len,vpkg_length); ++ if (len > dp->len - sizeof(dp_hdr_t) - dp_hdr->len) len = dp->len - sizeof(dp_hdr_t) - dp_hdr->len; + stream_read(demuxer->stream, dp_data+dp_hdr->len, len); + if((dp_data[dp_hdr->len]&0x20) && (sh_video->format==0x30335652)) --dp_hdr->chunks; else + dp_hdr->len+=len; +@@ -998,6 +1000,7 @@ + extra[0]=1; extra[1]=0; // offset of the first chunk + if(0x00==(vpkg_header&0xc0)){ + // first fragment: ++ if (len > dp->len - sizeof(dp_hdr_t)) len = dp->len - sizeof(dp_hdr_t); + dp_hdr->len=len; + stream_read(demuxer->stream, dp_data, len); + ds->asf_packet=dp; --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/patches/60_CVE-2007-1246.dpatch +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/patches/60_CVE-2007-1246.dpatch @@ -0,0 +1,18 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 60_CVE-2007-1246.dpatch by William Grant +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad mplayer-0.99+1.0pre7try2+cvs20060117~/loader/dmo/DMO_VideoDecoder.c mplayer-0.99+1.0pre7try2+cvs20060117/loader/dmo/DMO_VideoDecoder.c +--- mplayer-0.99+1.0pre7try2+cvs20060117~/loader/dmo/DMO_VideoDecoder.c 2007-12-01 23:23:50.000000000 +1100 ++++ mplayer-0.99+1.0pre7try2+cvs20060117/loader/dmo/DMO_VideoDecoder.c 2007-12-01 23:24:51.000000000 +1100 +@@ -121,6 +121,7 @@ + + this->iv.m_bh = (BITMAPINFOHEADER*)malloc(bihs); + memcpy(this->iv.m_bh, format, bihs); ++ this->iv.m_bh->biSize = bihs; + + this->iv.m_State = STOP; + //this->iv.m_pFrame = 0; --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/patches/02_mplayer.conf.dpatch +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/patches/02_mplayer.conf.dpatch @@ -0,0 +1,24 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run + +@DPATCH@ + +--- mplayer/etc/example.conf.old 2005-12-02 18:21:41.424000000 +0100 ++++ mplayer/etc/example.conf 2005-12-02 18:23:51.924000000 +0100 +@@ -17,7 +17,7 @@ + ################## + + # Specify default video driver (see -vo help for a list). +-#vo=xv ++vo=xv,sdl,x11 + + # Use SDL video with the aalib subdriver by default. + #vo = sdl:aalib +@@ -71,7 +71,7 @@ + ################## + + # Specify default audio driver (see -ao help for a list). +-#ao=oss ++ao=alsa,oss,sdl,esd,arts + + # Use SDL audio driver with the esd subdriver by default. + #ao = sdl:esd --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/patches/08_nsv-support.dpatch +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/patches/08_nsv-support.dpatch @@ -0,0 +1,18 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run + +@DPATCH@ + +--- mplayer/etc/codecs.conf 2006-01-16 14:27:07.000000000 -0500 ++++ mplayer/etc/codecs.conf.patched 2006-05-15 09:42:20.000000000 -0400 +@@ -2303,9 +2303,10 @@ audiocodec faad + info "FAAD AAC (MPEG-2/MPEG-4 Audio) decoder" + status working + fourcc mp4a,MP4A +- fourcc "AAC " ; Used in NSV ++ fourcc "AAC ","AACP" ; Used in NSV + format 0xff + format 0x706D ++ format 0x50434141 + driver faad + dll libfaad2 + --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/patches/65_CVE-2008-0485.dpatch +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/patches/65_CVE-2008-0485.dpatch @@ -0,0 +1,63 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 65_CVE-2008-0485.dpatch by William Grant +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix CVE-2008-0485. + +@DPATCH@ +diff -urNad mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/demux_mov.c mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/demux_mov.c +--- mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/demux_mov.c 2006-01-13 07:04:34.000000000 +1100 ++++ mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/demux_mov.c 2008-03-09 12:17:56.000000000 +1100 +@@ -51,6 +51,9 @@ + #include + #endif + ++#define FFMAX(a,b) ((a) > (b) ? (a) : (b)) ++#define FFMIN(a,b) ((a) > (b) ? (b) : (a)) ++ + #define BE_16(x) (((unsigned char *)(x))[0] << 8 | \ + ((unsigned char *)(x))[1]) + #define BE_32(x) (((unsigned char *)(x))[0] << 24 | \ +@@ -170,11 +173,12 @@ + i=trak->chunkmap_size; + while(i>0){ + --i; +- for(j=trak->chunkmap[i].first;jchunkmap[i].first, 0); ++ for(;jchunks[j].desc=trak->chunkmap[i].sdid; + trak->chunks[j].size=trak->chunkmap[i].spc; + } +- last=trak->chunkmap[i].first; ++ last=FFMIN(trak->chunkmap[i].first, trak->chunks_size); + } + + #if 0 +@@ -232,6 +236,8 @@ + s=0; + for(j=0;jdurmap_size;j++){ + for(i=0;idurmap[j].num;i++){ ++ if (s >= trak->samples_size) ++ break; + trak->samples[s].pts=pts; + ++s; + pts+=trak->durmap[j].dur; +@@ -243,6 +249,8 @@ + for(j=0;jchunks_size;j++){ + off_t pos=trak->chunks[j].pos; + for(i=0;ichunks[j].size;i++){ ++ if (s >= trak->samples_size) ++ break; + trak->samples[s].pos=pos; + mp_msg(MSGT_DEMUX, MSGL_DBG3, "Sample %5d: pts=%8d off=0x%08X size=%d\n",s, + trak->samples[s].pts, +@@ -1395,8 +1403,7 @@ + if( udta_len>udta_size) + udta_len=udta_size; + { +- char dump[udta_len-4]; +- stream_read(demuxer->stream, (char *)&dump, udta_len-4-4); ++ stream_skip(demuxer->stream, udta_len-4-4); + udta_size -= udta_len; + } + } --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/patches/62_CVE-2006-6172.dpatch +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/patches/62_CVE-2006-6172.dpatch @@ -0,0 +1,55 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 62_CVE-2006-6172.dpatch by William Grant +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/realrtsp/asmrp.c mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/realrtsp/asmrp.c +--- mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/realrtsp/asmrp.c 2004-08-31 06:17:31.000000000 +1000 ++++ mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/realrtsp/asmrp.c 2007-12-02 22:03:43.000000000 +1100 +@@ -40,6 +40,7 @@ + #include + #include + #include ++#include "asmrp.h" + + /* + #define LOG +@@ -645,8 +646,10 @@ + #ifdef LOG + printf ("rule #%d is true\n", rule_num); + #endif +- matches[num_matches] = rule_num; +- num_matches++; ++ 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 -urNad mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/realrtsp/asmrp.h mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/realrtsp/asmrp.h +--- mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/realrtsp/asmrp.h 2003-04-18 06:38:57.000000000 +1000 ++++ mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/realrtsp/asmrp.h 2007-12-02 22:04:13.000000000 +1100 +@@ -40,6 +40,8 @@ + #ifndef HAVE_ASMRP_H + #define HAVE_ASMRP_H + ++#define MAX_RULEMATCHES 16 ++ + int asmrp_match (const char *rules, int bandwidth, int *matches) ; + + #endif +diff -urNad mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/realrtsp/real.c mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/realrtsp/real.c +--- mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/realrtsp/real.c 2006-01-07 01:39:10.000000000 +1100 ++++ mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/realrtsp/real.c 2007-12-02 22:04:02.000000000 +1100 +@@ -528,7 +528,7 @@ + int j=0; + int n; + char b[64]; +- int rulematches[16]; ++ int rulematches[MAX_RULEMATCHES]; + + #ifdef LOG + printf("calling asmrp_match with:\n%s\n%u\n", desc->stream[i]->asm_rule_book, bandwidth); --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/patches/05_gnome-screensaver-handling.dpatch +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/patches/05_gnome-screensaver-handling.dpatch @@ -0,0 +1,50 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 05_gnome-screensaver-handling.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: No description. + +@DPATCH@ +diff -urNad mplayer-0.99+1.0pre7try2+cvs20060117~/libvo/x11_common.c mplayer-0.99+1.0pre7try2+cvs20060117/libvo/x11_common.c +--- mplayer-0.99+1.0pre7try2+cvs20060117~/libvo/x11_common.c 2006-01-12 21:04:35.000000000 +0100 ++++ mplayer-0.99+1.0pre7try2+cvs20060117/libvo/x11_common.c 2006-02-25 20:51:47.000000000 +0100 +@@ -72,6 +72,7 @@ + static int dpms_disabled = 0; + static int timeout_save = 0; + static int kdescreensaver_was_running = 0; ++static int gnome_screensaver_was_running = 0; + + char *mDisplayName = NULL; + Display *mDisplay = NULL; +@@ -1675,7 +1676,12 @@ + ("dcop kdesktop KScreensaverIface enable true 2>/dev/null >/dev/null"); + kdescreensaver_was_running = 0; + } +- ++ if (gnome_screensaver_was_running && stop_xscreensaver) ++ { ++ system ++ ("gconftool-2 --type bool --set /apps/gnome-screensaver/idle_activation_enabled true 2>/dev/null >/dev/null"); ++ gnome_screensaver_was_running = 0; ++ } + + } + +@@ -1725,6 +1731,17 @@ + system + ("dcop kdesktop KScreensaverIface enable false 2>/dev/null >/dev/null"); + } ++ if (stop_xscreensaver && !gnome_screensaver_was_running) ++ { ++ gnome_screensaver_was_running = ++ (system ++ ("gconftool-2 --get /apps/gnome-screensaver/idle_activation_enabled | grep true 2>/dev/null >/dev/null") ++ == 0); ++ if (gnome_screensaver_was_running) ++ system ++ ("gconftool-2 --type bool --set /apps/gnome-screensaver/idle_activation_enabled false 2>/dev/null >/dev/null"); ++ } ++ + } + + static XErrorHandler old_handler = NULL; --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/patches/68_CVE-2008-1558.dpatch +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/patches/68_CVE-2008-1558.dpatch @@ -0,0 +1,19 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 68_CVE-2008-1558.dpatch by Stefan Lesicnik +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix CVE-2008-1558. + +@DPATCH@ +--- libmpdemux/realrtsp/sdpplin.c.patch 2008-10-10 22:05:34.000000000 +0200 ++++ mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/realrtsp/sdpplin.c 2008-10-10 22:06:45.000000000 +0200 +@@ -290,7 +290,8 @@ sdpplin_t *sdpplin_parse(char *data) { + + if(filter(data,"a=StreamCount:integer;",&buf)) { + desc->stream_count=(unsigned int)atoi(buf); +- desc->stream=malloc(sizeof(sdpplin_stream_t*)*desc->stream_count); ++ desc->stream=calloc(desc->stream_count, sizeof(sdpplin_stream_t*)); ++ if (!desc->stream) desc->stream_count = 0; + handled=1; + data=nl(data); + } --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/patches/03_fix-linking.dpatch +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/patches/03_fix-linking.dpatch @@ -0,0 +1,33 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run + +@DPATCH@ +diff -urNad mplayer-0.99+1.0pre7try2+cvs20060117~/configure mplayer-0.99+1.0pre7try2+cvs20060117/configure +--- mplayer-0.99+1.0pre7try2+cvs20060117~/configure 2006-01-24 01:28:50.000000000 +0100 ++++ mplayer-0.99+1.0pre7try2+cvs20060117/configure 2006-01-24 01:29:19.000000000 +0100 +@@ -4011,9 +4011,7 @@ + fi + if test "$_aa" = yes ; then + _def_aa='#define HAVE_AA 1' +- if cygwin ; then +- _ld_aa=`aalib-config --libs | cut -d " " -f 2,5,6` +- fi ++ _ld_aa=`aalib-config --libs | cut -d " " -f 2,5,6` + _vosrc="$_vosrc vo_aa.c" + _vomodules="aa $_vomodules" + else +@@ -5258,6 +5256,7 @@ + else + _def_fontconfig='#undef HAVE_FONTCONFIG' + fi ++_ld_fontconfig="-lfontconfig" + echores "$_fontconfig" + + echocheck "fribidi with charsets" +@@ -5670,6 +5669,7 @@ + if test "$_faac" = yes ; then + _def_faac="#define HAVE_FAAC 1" + _codecmodules="faac $_codecmodules" ++ _ld_faac="-lfaac -lmp4v2 -lstdc++" + else + _def_faac="#undef HAVE_FAAC" + _nocodecmodules="faac $_nocodecmodules" --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/patches/06_close_gracefully.dpatch +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/patches/06_close_gracefully.dpatch @@ -0,0 +1,49 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run + +@DPATCH@ + +=================================================================== +RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v +retrieving revision 1.206 +retrieving revision 1.207 +diff -u -r1.206 -r1.207 +--- main/libvo/x11_common.c 2006/04/16 13:38:28 1.206 ++++ main/libvo/x11_common.c 2006/04/19 15:58:10 1.207 +@@ -100,6 +100,8 @@ + static Atom XA_WIN_LAYER; + static Atom XA_WIN_HINTS; + static Atom XA_BLACKBOX_PID; ++static Atom XAWM_PROTOCOLS; ++static Atom XAWM_DELETE_WINDOW; + + #define XA_INIT(x) XA##x = XInternAtom(mDisplay, #x, False) + +@@ -357,6 +359,8 @@ + XA_INIT(_WIN_LAYER); + XA_INIT(_WIN_HINTS); + XA_INIT(_BLACKBOX_PID); ++ XA_INIT(WM_PROTOCOLS); ++ XA_INIT(WM_DELETE_WINDOW); + } + + void update_xinerama_info(void) { +@@ -1137,6 +1141,11 @@ + XSetWMNormalHints(mDisplay, vo_window, &vo_hint); + vo_fs_flip = 0; + break; ++ case ClientMessage: ++ if (Event.xclient.message_type == XAWM_PROTOCOLS && ++ Event.xclient.data.l[0] == XAWM_DELETE_WINDOW) ++ mplayer_put_key(KEY_CLOSE_WIN); ++ break; + } + } + return ret; +@@ -1241,6 +1250,7 @@ + ret_win = + XCreateWindow(mDisplay, mRootWin, x, y, width, height, 0, depth, + CopyFromParent, vis, xswamask, &xswa); ++ XSetWMProtocols(mDisplay, ret_win, &XAWM_DELETE_WINDOW, 1); + if (!f_gc) + f_gc = XCreateGC(mDisplay, ret_win, 0, 0); + XSetForeground(mDisplay, f_gc, 0); --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/patches/57_demuxer_heap_overflow.dpatch +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/patches/57_demuxer_heap_overflow.dpatch @@ -0,0 +1,58 @@ +#! /bin/sh -e + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac +exit 0 + +Index: libmpdemux/demuxer.h +=================================================================== +RCS file: /cvsroot/mplayer/main/libmpdemux/demuxer.h,v +retrieving revision 1.87 +retrieving revision 1.90 +diff -u -r1.87 -r1.90 +--- Mplayer-1.0pre7try2/libmpdemux/demuxer.h 9 Feb 2006 19:39:51 -0000 1.87 ++++ Mplayer-1.0pre7try3/libmpdemux/demuxer.h 12 Feb 2006 17:01:30 -0000 1.90 +@@ -190,17 +190,19 @@ + dp->flags=0; + dp->refcount=1; + dp->master=NULL; +- dp->buffer=len?(unsigned char*)malloc(len+8):NULL; +- if(len) memset(dp->buffer+len,0,8); ++ dp->buffer=NULL; ++ if (len > 0 && (dp->buffer = (unsigned char *)malloc(len + 8))) ++ memset(dp->buffer + len, 0, 8); ++ else ++ dp->len = 0; + return dp; + } + + inline static void resize_demux_packet(demux_packet_t* dp, int len) + { +- if(len) ++ if(len > 0) + { + dp->buffer=(unsigned char *)realloc(dp->buffer,len+8); +- memset(dp->buffer+len,0,8); + } + else + { +@@ -208,6 +210,10 @@ + dp->buffer=NULL; + } + dp->len=len; ++ if (dp->buffer) ++ memset(dp->buffer + len, 0, 8); ++ else ++ dp->len = 0; + } + + inline static demux_packet_t* clone_demux_packet(demux_packet_t* pack){ --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/debian/patches/64_CVE-2008-0225_0238.dpatch +++ mplayer-0.99+1.0pre7try2+cvs20060117/debian/patches/64_CVE-2008-0225_0238.dpatch @@ -0,0 +1,218 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 64_CVE-2008-0225_0238.dpatch by William Grant +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix CVE-2008-0225 and CVE-2008-0238. + +@DPATCH@ +diff -urNad mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/realrtsp/rmff.c mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/realrtsp/rmff.c +--- mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/realrtsp/rmff.c 2003-05-30 05:34:01.000000000 +1000 ++++ mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/realrtsp/rmff.c 2008-03-09 12:14:08.000000000 +1100 +@@ -28,6 +28,7 @@ + + #include "rmff.h" + #include "xbuffer.h" ++#include "mp_msg.h" + + /* + #define LOG +@@ -74,9 +75,13 @@ + * writes header data to a buffer + */ + +-static void rmff_dump_fileheader(rmff_fileheader_t *fileheader, char *buffer) { ++static int rmff_dump_fileheader(rmff_fileheader_t *fileheader, char *buffer, int bufsize) { ++ ++ if (!fileheader) return 0; ++ ++ if (bufsize < RMFF_FILEHEADER_SIZE) ++ return -1; + +- if (!fileheader) return; + fileheader->object_id=BE_32(&fileheader->object_id); + fileheader->size=BE_32(&fileheader->size); + fileheader->object_version=BE_16(&fileheader->object_version); +@@ -92,11 +97,17 @@ + fileheader->file_version=BE_32(&fileheader->file_version); + fileheader->num_headers=BE_32(&fileheader->num_headers); + fileheader->object_id=BE_32(&fileheader->object_id); ++ ++ return RMFF_FILEHEADER_SIZE; + } + +-static void rmff_dump_prop(rmff_prop_t *prop, char *buffer) { ++static int rmff_dump_prop(rmff_prop_t *prop, char *buffer, int bufsize) { ++ ++ if (!prop) return 0; ++ ++ if (bufsize < RMFF_PROPHEADER_SIZE) ++ return -1; + +- if (!prop) return; + prop->object_id=BE_32(&prop->object_id); + prop->size=BE_32(&prop->size); + prop->object_version=BE_16(&prop->object_version); +@@ -132,13 +143,20 @@ + prop->num_streams=BE_16(&prop->num_streams); + prop->flags=BE_16(&prop->flags); + prop->object_id=BE_32(&prop->object_id); ++ ++ return RMFF_PROPHEADER_SIZE; + } + +-static void rmff_dump_mdpr(rmff_mdpr_t *mdpr, char *buffer) { ++static int rmff_dump_mdpr(rmff_mdpr_t *mdpr, char *buffer, int bufsize) { + + int s1, s2, s3; + +- if (!mdpr) return; ++ if (!mdpr) return 0; ++ ++ if (!(bufsize > RMFF_MDPRHEADER_SIZE + mdpr->stream_name_size + mdpr->mime_type_size && ++ (unsigned)bufsize - RMFF_MDPRHEADER_SIZE - mdpr->stream_name_size - mdpr->mime_type_size > mdpr->type_specific_len)) ++ return -1; ++ + mdpr->object_id=BE_32(&mdpr->object_id); + mdpr->size=BE_32(&mdpr->size); + mdpr->object_version=BE_16(&mdpr->object_version); +@@ -180,13 +198,19 @@ + mdpr->duration=BE_32(&mdpr->duration); + mdpr->object_id=BE_32(&mdpr->object_id); + ++ return RMFF_MDPRHEADER_SIZE + s1 + s2 + s3; + } + +-static void rmff_dump_cont(rmff_cont_t *cont, char *buffer) { ++static int rmff_dump_cont(rmff_cont_t *cont, char *buffer, int bufsize) { + + int p; + +- if (!cont) return; ++ if (!cont) return 0; ++ ++ if (bufsize < RMFF_CONTHEADER_SIZE + cont->title_len + cont->author_len + ++ cont->copyright_len + cont->comment_len) ++ return -1; ++ + cont->object_id=BE_32(&cont->object_id); + cont->size=BE_32(&cont->size); + cont->object_version=BE_16(&cont->object_version); +@@ -220,11 +244,18 @@ + cont->size=BE_32(&cont->size); + cont->object_version=BE_16(&cont->object_version); + cont->object_id=BE_32(&cont->object_id); ++ ++ return RMFF_CONTHEADER_SIZE + cont->title_len + cont->author_len + ++ cont->copyright_len + cont->comment_len; + } + +-static void rmff_dump_dataheader(rmff_data_t *data, char *buffer) { ++static int rmff_dump_dataheader(rmff_data_t *data, char *buffer, int bufsize) { ++ ++ if (!data) return 0; ++ ++ if (bufsize < RMFF_DATAHEADER_SIZE) ++ return -1; + +- if (!data) return; + data->object_id=BE_32(&data->object_id); + data->size=BE_32(&data->size); + data->object_version=BE_16(&data->object_version); +@@ -240,33 +271,48 @@ + data->size=BE_32(&data->size); + data->object_version=BE_16(&data->object_version); + data->object_id=BE_32(&data->object_id); ++ ++ return RMFF_DATAHEADER_SIZE; + } + + int rmff_dump_header(rmff_header_t *h, char *buffer, int max) { + +- int written=0; ++ int written=0, size; + rmff_mdpr_t **stream=h->streams; + +- rmff_dump_fileheader(h->fileheader, &buffer[written]); +- written+=h->fileheader->size; +- rmff_dump_prop(h->prop, &buffer[written]); +- written+=h->prop->size; +- rmff_dump_cont(h->cont, &buffer[written]); +- written+=h->cont->size; ++ if ((size=rmff_dump_fileheader(h->fileheader, &buffer[written], max)) < 0) ++ goto buftoosmall; ++ written+=size; ++ max -= size; ++ if ((size=rmff_dump_prop(h->prop, &buffer[written], max)) < 0) ++ goto buftoosmall; ++ written+=size; ++ max -= size; ++ if ((size=rmff_dump_cont(h->cont, &buffer[written], max)) < 0) ++ goto buftoosmall; ++ written+=size; ++ max -= size; + if (stream) + { + while(*stream) + { +- rmff_dump_mdpr(*stream, &buffer[written]); +- written+=(*stream)->size; ++ if ((size=rmff_dump_mdpr(*stream, &buffer[written], max)) < 0) ++ goto buftoosmall; ++ written+=size; ++ max -= size; + stream++; + } + } + +- rmff_dump_dataheader(h->data, &buffer[written]); +- written+=18; ++ if ((size=rmff_dump_dataheader(h->data, &buffer[written], max)) < 0) ++ goto buftoosmall; ++ written+=size; + + return written; ++ ++buftoosmall: ++ mp_msg(MSGT_STREAM, MSGL_ERR, "rmff_dumpheader: buffer too small, aborting. Please report\n"); ++ return -1; + } + + void rmff_dump_pheader(rmff_pheader_t *h, char *data) { +diff -urNad mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/realrtsp/rmff.h mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/realrtsp/rmff.h +--- mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/realrtsp/rmff.h 2003-06-12 02:48:08.000000000 +1000 ++++ mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/realrtsp/rmff.h 2008-03-09 12:14:08.000000000 +1100 +@@ -49,6 +49,12 @@ + + #define RMFF_HEADER_SIZE 0x12 + ++#define RMFF_FILEHEADER_SIZE 18 ++#define RMFF_PROPHEADER_SIZE 50 ++#define RMFF_MDPRHEADER_SIZE 46 ++#define RMFF_CONTHEADER_SIZE 18 ++#define RMFF_DATAHEADER_SIZE 18 ++ + #define FOURCC_TAG( ch0, ch1, ch2, ch3 ) \ + (((long)(unsigned char)(ch3) ) | \ + ( (long)(unsigned char)(ch2) << 8 ) | \ +diff -urNad mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/realrtsp/rtsp_session.c mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/realrtsp/rtsp_session.c +--- mplayer-0.99+1.0pre7try2+cvs20060117~/libmpdemux/realrtsp/rtsp_session.c 2006-01-09 09:57:59.000000000 +1100 ++++ mplayer-0.99+1.0pre7try2+cvs20060117/libmpdemux/realrtsp/rtsp_session.c 2008-03-09 12:14:08.000000000 +1100 +@@ -134,7 +134,17 @@ + } + } + +- rtsp_session->header_len=rmff_dump_header(h,rtsp_session->header,1024); ++ rtsp_session->header_len=rmff_dump_header(h,rtsp_session->header,HEADER_SIZE); ++ ++ if (rtsp_session->header_len < 0) { ++ printf("rtsp_session: error while dumping RMFF headers, session can not be established.\n"); ++ rtsp_close(rtsp_session->s); ++ free (server); ++ free (mrl_line); ++ rtsp_session->recv = xbuffer_free(rtsp_session->recv); ++ free(rtsp_session); ++ return NULL; ++ } + + rtsp_session->recv = xbuffer_copyin(rtsp_session->recv, 0, rtsp_session->header, rtsp_session->header_len); + rtsp_session->recv_size = rtsp_session->header_len; --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/config.guess +++ mplayer-0.99+1.0pre7try2+cvs20060117/config.guess @@ -0,0 +1,1466 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2005-08-03' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerppc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + *86) UNAME_PROCESSOR=i686 ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/TOOLS/midentify +++ mplayer-0.99+1.0pre7try2+cvs20060117/TOOLS/midentify @@ -0,0 +1,5 @@ +#!/bin/sh +mplayer -vo null -ao null -frames 0 -identify "$@" 2>/dev/null | + grep "^ID" | + sed -e 's/[`\\!$"]/\\&/g' | + sed -e '/^ID_FILENAME/ { s/^ID_FILENAME=\(.*\)/ID_FILENAME="\1"/g; }' --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/TOOLS/w32codec_dl.pl +++ mplayer-0.99+1.0pre7try2+cvs20060117/TOOLS/w32codec_dl.pl @@ -0,0 +1,169 @@ +#!/usr/bin/perl + +## usage: w32codec_dl.pl (codec.conf location) + +# this script will use MS's codec dl interface as used by MS Media Player +# to attempt to locate the codecs listed in codecs.conf. It will download +# them to a directory "codecs/" below the current dir. +# you will need the libwww-perl stuff and the utility "cabextract" +# which may be found at http://www.kyz.uklinux.net/cabextract.php3 + +# By Tom Lees, 2002. I hereby place this script into the public domain. + +#use LWP::Debug qw(+); +use LWP::UserAgent; + +$ua = LWP::UserAgent->new; +$ua->agent ("Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)"); + +# Parse the etc/codecs.conf file +my $cconf = $ARGV[0]; +open CCONF, "<$cconf"; + +my $codec = "(none)"; +my $mscodec = 0; + +my $cc, @ccl; + +mkdir "codecs"; +chdir "codecs"; + +CC: while () +{ + next CC if (m/^[ \t]*\;/); + s/\;.*//g; + s/#.*//g; + + if (m/^videocodec (.*)/) + { + $codec = $1; + } + elsif (m/^[ \t]+driver (.*)/) + { + if ($1 eq "dshow" || $1 eq "vfw") + { + $mscodec = 1; + } + else + { + $mscodec = 0; + } + } + elsif (m/^[ \t]+fourcc (.*)/ && $mscodec == 1) + { + $cclist = $1; + chomp $cclist; + #@ccl = (); + do + { + if ($cclist =~ m/\"(....)\"[, ]*(.*)/) + { + $cc = $1; + $cclist = $2; + } + elsif ($cclist =~ m/[, ]*(....)[, ]*(.*)/) + { + $cc = $1; + $cclist = $2; + } + else + { + $cc = $cclist; + $cclist = ""; + } + if (!($cc =~ m/^[ \t]+/)) + { + push @ccl, ($cc); + } + } while (length ($cclist) > 0); + } +} +close CCONF; + +# Find the codecs +open CODEC_CABS, ">codecs.locations.info"; +%fcc_try = (); +while ($#ccl > 0) +{ + $cc = pop (@ccl); + if (!$fcc_try{"$cc"}) + { + $fcc_try{"$cc"} = 1; + if (!find_codec ($cc)) + { + print "$cc found\n"; + } + else + { + print "MS didn't find $cc\n"; + } + } +} +close CODEC_CABS; + +%got_codecs = (); +sub find_codec +{ + my ($fourcc) = @_; + + my $guid = sprintf ("%08X", unpack ("V", $fourcc))."-0000-0010-8000-00AA00389B71"; + + my $req = HTTP::Request->new (POST => "http://activex.microsoft.com/objects/ocget.dll"); + $req->header ('Accept', '*/*'); + $req->content_type ('application/x-www-form-urlencoded'); + $req->content ("CLSID=%7B${guid}%7D\n"); + #$req->content ('CLSID={'.${guid}.'}'); + + my $res = $ua->request ($req); + + if ($res->is_success) { + print "Lookup returned success... weird!\n"; + return 1; + } else { + # Codec location + if ($res->code == 302) + { + my $loc = $res->headers->header ("Location"); + if (!$got_codecs{"$loc"}) + { + print CODEC_CABS "$loc\n"; + $got_codecs{"$loc"} = 1; + get_codec ($loc); + } +# else +# { +# print "Already have $loc\n"; +# } + return 0; + } + else + { +# print "Lookup failed (Microsoft probably doesn't know this codec)\n"; + return 1; + } + } +} + +sub get_codec +{ + my ($url) = @_; + + my $req = HTTP::Request->new (GET => $url); + $req->header ("Accept", "*/*"); + my $res = $ua->request ($req); + + if ($res->is_success) + { + open TMP, ">tmp.cab" or die "Unable to open tmp.cab"; + print TMP $res->content; + close TMP; + + system "cabextract tmp.cab"; + unlink "tmp.cab"; + } + else + { + print "No such file!\n"; + } +} + --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/TOOLS/x2mpsub.sh +++ mplayer-0.99+1.0pre7try2+cvs20060117/TOOLS/x2mpsub.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# +# This script converts the subtitles in the current directory into +# MPsub format (into ./converted-subtitles/*) +# +# Gabucino. No warranty. :) +# + +TMP="x2mpsub-$RANDOM" +mkdir "$TMP" +touch "$TMP/$TMP" + +for x in *; do + echo "Converting $x" + mplayer "$TMP/$TMP" -sub "$x" -dumpmpsub -quiet > /dev/null 2> /dev/null + mv dump.mpsub "$TMP/$x" +done + +rm "$TMP/$TMP" +mv "$TMP" converted-subtitles --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/TOOLS/wma2ogg.pl +++ mplayer-0.99+1.0pre7try2+cvs20060117/TOOLS/wma2ogg.pl @@ -0,0 +1,341 @@ +#!/usr/bin/perl + +################################# +# wma converter 0.3.6 for Linux # +################################# + +# Made by Peter Simon +# License: GNU GPL +# +# Needed programs: +# +# Getopt::Long - Perl Module +# MPlayer - http://www.mplayerhq.hu +# BladeEnc - http://bladeenc.mp3.no +# oggenc - http://www.vorbis.com +# mp3info - http://www.ibiblio.org/mp3info + +# changelog: +# 0.1.0 +# decoding all files to wav without any switches and encoders +# 0.2.0 +# converting to mp3 or ogg with bitrate, delete options +# 0.2.1 +# L.A.M.E. support for fanatics +# Default output filetype: ogg +# Some error warnings +# 0.3.0 +# Reading the wma tags out and puting into the mp3 or the ogg tags. (What the MPlayer shows of those.) +# Default output bitrate: the original bitrate +# Simlink for the default encode mode (wma2ogg = ogg, wma2mp3 = mp3) +# 0.3.1 +# Neglecting missing encoders if those are not in use. +# 0.3.2 +# Using mp3info for the mp3 tags +# 0.3.3 +# Convert more then one files in the start dir. +# 0.3.4-5 +# Some bugfixes. +# 0.3.6 +# Some bugfixes by Diego Biurrun + +# Why BladeEnc? +# Eg.: The L.A.M.E.'s code isn't compatible for some hardwer-decoders. Makes noise and clashings. +# I never met this trouble using BladeEnc. +# That's it. + +use Getopt::Long qw(:config pass_through); + +$ver="0.3.6"; + +GetOptions("help|?",\&showhelp, 'a' => \$all, "file|f=s" => \@files,"t=s" => \$mtype, "lame" => \$needlame, "del" => \$delete, "br=i" => \$sbrate); + +if (@ARGV) { + foreach (@ARGV) { + error ("Missing parameter after the $_ switch!"); + } + exit; +} + +print "wma2ogg $ver\nPeter Simon "; + +if (!$all && !@files) { + error ("There is no selected file!"); + exit; +} + +if ($0 =~/wma2mp3/ && !$mtype) { + $mtype="mp3"; +} + +if ($mtype eq "ogg") { + $ttype{"ogg"}="oggenc"; + needed_prgs (oggenc, "http://www.vorbis.com"); +} + +if ($needlame && $mtype eq "ogg") { + error ("\nYou can not use L.A.M.E. & oggenc together!\n"); + exit; +} + +if (!$mtype && !$needlame) { + $mtype="ogg"; + $ttype{"ogg"}="oggenc"; + needed_prgs (oggenc, "http://www.vorbis.com"); +} + + +if (!$needlame && $mtype eq "mp3") { + $ttype{"mp3"}="BladeEnc"; + needed_prgs (BladeEnc, "http://bladeenc.mp3.no", mp3info, "http://www.ibiblio.org/mp3info"); +} + +if ($needlame) { + $mtype="mp3"; + $ttype{"mp3"}="lame"; + needed_prgs (lame, "http://lame.sourceforge.net", mp3info, "http://www.ibiblio.org/mp3info"); +} + +# Main program + print "\nUsing lame - WARNING - this is not optimal!\n"; + ch_needed (); + ch_type (); + ch_files (); + decode(); +# the end. + + +sub ch_type { + $o_type=$ttype{$mtype}; + + if ($mtype ne "wav") { + $def_path=$ENV{PATH}; + @exec_path=split /\:/, $def_path; + foreach $temp_path (@exec_path) { + if (-d $temp_path && !$enc_ok) { + $enc_ok=`find $temp_path -name $o_type -type f -maxdepth 1 2>/dev/null`; + chomp ($enc_ok); + } + } + } + if ((!$o_type || !$enc_ok) && $mtype ne "wav") { + error("Unknown encoder."); + exit; + } +} + +sub ch_br { + if ($sbrate && ((($sbrate <32 || $sbrate>350) && $mtype eq "mp3") || (($sbrate<64 || $sbrate>500) && $mtype eq "ogg") )) { + error("Invalid, missing or redundant bitrate."); + exit; + } +} + +sub ch_files { + if ($all && @files) { + error ("You can't use -a switch and -f together!"); + exit; + } + + if ($all) { + @enc_files=`ls | grep '.wma'\$`; + foreach (@enc_files) { + chomp $_; + } + } + + if (@files) { + @enc_files=@files; + } + +} + +sub showhelp { +print "\n\nUsage: wma2ogg [OPTIONS] (-f FILE1 | -f FILE2 ... | -a)\n +-f, -file filename +-a converts all wma files in the current directory\n +OPTIONS: +-t output filetype (ogg, mp3) [default=ogg] +-lame I wanna use L.A.M.E. sure enough! +-br bitrate (kb/s) [default=from the wma] +-del remove wma file(s) after the transcoding\n"; +print $miss_text; +print "\n$errtext\nExiting program.\n"; +} + +sub error { + $errtext=@_[0]; + showhelp (); + +} + +sub missing_prg { + $what=$keys; + $that=$needed{$keys}; + $miss_text.="\nThe needed \'$what\' program is missing, see: $that!"; +} + +sub ch_needed { + + `perl -e 'use Getopt::Long;' 2>./err`; + open (FILE, "<./err"); + while ($sor=) { + if ($sor =~ /Can\'t locate/) { + missing_prg ("Getopt::Long", ": your Perl is too old... (uhhh... get a new one!)"); + } + } + `rm ./err`; + + + foreach $keys (keys %needed) { + `$keys 2>./err`; + open (FILE, "<./err"); + while ($sor=) { + if ($sor =~ /$keys\: command not found/) { + missing_prg (); + $error=1; + } + } + `rm ./err`; + } + + close FILE; + if ($error) { + showhelp (); + exit; + } +} + +sub get_tags { + my $outfile; + open (FILE, "<./1"); + while ($sor=) { + $outfile.=$sor; + } + close FILE; + + $outfile=~ s/\((\d+\,\d+)\ kbit\)/$1/e; + print "\noriginal bitrate: $1"; + $kept_orig_brate=$1; + $kept_orig_brate=~ s/(\d+)/$1/e; + $kept_orig_brate=$1; + + if (!$sbrate) { + $brate=$kept_orig_brate; + print " (kept as default)"; + } else { + $brate=$sbrate; + print " (new: $brate,0)"; + } + + ch_br (); + + `rm ./1`; + my @temp_info=split /Clip\ info\:/, $outfile; + my @temp2_info=split /\n/, @temp_info[1]; + my @temp_title=split /\ /, $temp2_info[1],3; + my @temp_author=split /\ /, $temp2_info[2],3; + my @temp_copyright=split /\ /, $temp2_info[3],3; + my @temp_comments=split /\ /, $temp2_info[4],3; + return ($temp_title[2], $temp_author[2], $temp_copyright[2], $temp2_comments[2]); +} + +sub needed_prgs { + %needed=( + $_[0]=>$_[1], + $_[2]=>$_[3], + mplayer=>"http://www.mplayerhq.hu", + ); +} + +sub mp3_info { + if ($title) { + $infofile=" -t '$title'"; + } + if ($author) { + $infofile.=" -a '$author'"; + } + if ($comments) { + $infofile.=" -c '$comments'"; + } + + `mp3info "$p_name.$mtype" $infofile`; + + undef ($infofile); +} + + +sub decode { + foreach (@enc_files) { + $wav_name=$_; + $wav_name=~ s/(.+)\./$1/e; + $p_name=$1; + $wav_name=$p_name.".wav"; + $pwd=`pwd`; + chomp $pwd; + $pwd.="/t2"; + print "\nConverting $_ to \"wav\" file.\n"; + print "Using MPlayer...\n"; + + `mplayer "$_" -ao pcm -input conf="$pwd" 2>/dev/null >./1`; + `mv "audiodump.wav" "$wav_name"`; + + @tags=get_tags (); + + $title=$tags[0]; + print "\ntitle: $title"; + $author=$tags[1]; + print "\nauthor: $author"; + $copyright=$tags[2]; + print "\ncopyright: $copyright"; + $comments=$tags[3]; + print "\ncomments: $comments"; + + $comments=$copyright." ".$comments."Transcoded by wma2ogg"; + + print "\n\nConverting $wav_name to \"$mtype\" file."; + + print "\nUsing $o_type..."; + + if ($mtype eq "ogg") { + $br_sw="b"; + if ($title) { + $infofile=" -t '$title'"; + } + if ($author) { + $infofile.=" -a '$author'"; + } + if ($comments) { + $infofile.=" -c COMMENT='$comments'"; + } + + `"$o_type" "-$br_sw" "$brate" "-Q" "./$wav_name" $infofile "-o" "$p_name.$mtype"`; + `rm -f "$wav_name"`; + } + if ($mtype eq "mp3" && !$needlame) { + $br_sw="br"; + `"$o_type" "$wav_name" "$p_name.$mtype" "-$br_sw" "$brate" 2>/dev/null >/dev/null`; + + mp3_info (); + + `rm -f "$wav_name"`; + } + if ($mtype eq "mp3" && $needlame) { + + $br_sw="b"; + `"$o_type" "-$br_sw" "$brate" "-f" "$wav_name" "$p_name.$mtype" 2>/dev/null >/dev/null`; + + mp3_info (); + + `rm -f "$wav_name"`; + } + if ($delete) { + `rm -f "$_"`; + } + if (-e "./err") { + `rm ./err`; + } + } + print "\n\nDone.\n\n"; +} + --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/TOOLS/dvd2divxscript.pl +++ mplayer-0.99+1.0pre7try2+cvs20060117/TOOLS/dvd2divxscript.pl @@ -0,0 +1,264 @@ +#!/usr/bin/perl + +# +# (c) 2002-2004 by Florian Schilhabel +# +# +# version 0.1 initial release 22/08/2002 +# +# +# If you have any comments, suggestions, etc., feel free to send me a mail ;-)) +# flames and other things like that should go to /dev/null +# thankx to all the mplayer developers for this really *great* piece of software +# +# +# This script is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This script is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# +# +use Getopt::Long; + +# specify your default Settings here... + +$abr_default = 128; # The default AudioBitRate +$lang_default = "de"; # ... the language +$cdsize_default = 700; # ... the CD-Rom Size +$writedev_default = "0,1,0"; # ... the CD Writer Device +$speed_default = 4; # ... the writer speed +$dvd_device = "/dev/dvd"; # and the DVD Rom Device + +# end of default Settings + + + +sub delete_tempfiles { + if (open(FILE, "< audio.stderr")) { + close (FILE); + system ("rm audio.stderr") + } + if (open(FILE, "< frameno.avi")) { + close (FILE); + system ("rm frameno.avi"); + } + if (open(FILE, "< lavc_stats.txt")) { + close (FILE); + system ("rm lavc_stats.txt"); + } +} + +GetOptions( "help" => \$help, + "abr=i" => \$abr, + "lang=s" =>\$lang, + "cdsize=i" => \$cdsize, + "dvd=i" => \$dvd_track, + "keeptemp" => \$keeptemp, + "shutdown" => \$shutdown, + "out=s" => \$output, + "writecd" => \$writecd, + "writedev=s" => \$writedev, + "speed=i" => \$speed, + "dvd-device=s" => \$dvd_device ); + +if ($help) { + print "Welcome to the DVD to DIVX Helper Script\n"; + print "\n"; + print "this script encodes a DVD track in 3-pass mode to libavcodec's mpeg4\n"; + print "Optionally it writes the resulting MovieFile to a CD-Rom\n"; + print "as well as the corresponding audio track to mp3\n"; + print "Optionally it writes the resulting MovieFile to a CD-Rom\n"; + print "and shuts down the Computer.\n"; + print "If you like, you can watch the mencoder output on /dev/tty8\n"; + print "Usage:\n"; + print "--help show this text\n"; + print "--abr (AudioBitRate) Please enter the desired bitrate\n"; + print " this can be either [96|128|192] kbit/sec.\n"; + print " Default: 128 kbit/sec.\n"; + print "--lang specify the Language of the audio track\n"; + print " this can be for example or \n"; + print " Default: \n"; + print "--dvd specify the DVD Track, you want to encode\n"; + print "--cdsize specify the Size of your CD-ROM\n"; + print " Default: 700MB\n"; + print "--shutdown Shutdown the System, when the encoding process has finished\n"; + print " this will only be possible if you are root\n"; + print "--out Specify the Name of your encoded Movie\n"; + print " The File Extension will be appended automatically\n"; + print "--writecd takes the newly created Movie and writes it to a CD-Rom\n"; + print "--writedev is the usual cdrecord device identifier\n"; + print " for example 0,1,0\n"; + print "--speed the writing speed\n"; + print " Default: 4\n"; + print "--dvd-device device to pull the video off\n"; + print " Default: /dev/dvd\n"; + exit; +} + +delete_tempfiles(); + +# testing user values && set defaults... + +if ($abr == 96){} +elsif ($abr == 128) {} +elsif ($abr == 192) {} +elsif ($abr == 0 ) { + print "No AudioBitRate specified - Setting to Default Value\n"; + $abr = $abr_default; +} +else { +print "AudioBitRate not valid. please choose [96|128|192]\n"; +exit; +} + +if ($lang eq "") { + print "No Language specified - Setting to Default Value\n"; + $lang = $lang_default; +} +else {} + +if ($dvd_track == 0 ) { + print "No DVD Track selected - You must specify one with: --dvd trackno.\n"; + exit; +} + +if ($cdsize == 650) {} +elsif ($cdsize == 700) {} +elsif ($cdsize == 800) {} +elsif ($cdsize == 0 ) { + print "No CD Size Specified - Setting to Default Value\n"; + $cdsize = $cdsize_default; +} + +else { +print "CD Size not valid. please choose [650|700|800]\n"; +exit; +} + +if ($output eq "") { + print "No MovieName given - You must specify one with: --out [movie_name]\n"; + exit; +} +else { + ($name, $extension) = split(/./, $out); + if ($extension eq "avi") { + $vob_tempfile = "$name.vob"; + $avi_filename = "$output"; + } + else { + $vob_tempfile = "$output.vob"; + print "VOB CacheFile set to $vob_tempfile\n"; + $avi_filename = "$output.avi"; + print "Movie Filename set to $avi_filename\n"; + } +} + +if ($shutdown) { + # test who i am + $user = `id -u`; + if ($user == 0) { + print "System will be shut down after Movie encoding\n"; + } + else { + print "Cannot shutdown the system after Movie encoding - you are not 'root'\n"; + exit; + } +} + +if ($writecd) { + if ($writedev == "") { + print "Setting CD Writer Device to Default Value\n"; + $writedev = $writedev_default; + } + if ($speed == 0) { + print "Setting CD Writer Speed to Default value\n"; + $speed = $speed_default; + } + +} + + + +### + +print "Your Settings for this run are:\n"; +print "AudioBitRate: $abr\n"; +print "Language: $lang\n"; +print "DVD-Track: $dvd_track\n"; +print "CD-Rom Size: $cdsize\n"; +print "Movie FIlename: $avi_filename\n"; +if ($writecd) { + print "CD Writer Dev.: $writedev\n"; + print "Writer Speed: $speed\n"; +} + +# here comes the fun part... + +print "precacheing...\n"; +$status = system ("mencoder dvd://$dvd_track -ovc copy -oac copy -dvd-device $dvd_device -alang $lang -o $vob_tempfile 1>/dev/tty8 2>/dev/tty8"); +die "Prechacheing failed. mencoder exited with Status Code $?" unless $status == 0; + +print "Encoding Audio...\n"; +$status = system ("mencoder $vob_tempfile -ovc frameno -oac mp3lame -lameopts br=$abr:cbr:vol=3 -o frameno.avi 1>./audio.stderr 2>/dev/tty8"); +die "Encoding Audio failed. mencoder exited with Status Code $?" unless $status == 0; + +# now we have to find out the recommended bitrate for the Video encoding process... +# my current method to find this out is, hmm, well, *strange* +# but anyway, it works ;-)) + +open(FILE, "< audio.stderr") or die "Unable to open audio.stderr."; +@lines = ; +foreach $line (@lines) { + ($index, $zz) = split(" ", $line); + if ($index eq "Recommended") { + ($a, $b, $c, $d, $size, $f, $bitrate) = split(" ", $line); + if ($cdsize == $size) { + $video_bitrate = $bitrate; + print "Setting Videobitrate to $video_bitrate\n"; + } + } +} +close (FILE); + +print "Encoding Video Stream, 1st pass...\n"; +$status = system ("mencoder $vob_tempfile -ovc lavc -lavcopts vpass=1:vcodec=mpeg4:vbitrate=$video_bitrate:vhq -oac copy -o $avi_filename 1>/dev/tty8 2>/dev/tty8"); +die "Encoding Video Stream failed. mencoder exited with Status Code $?" unless $status == 0; + +print "Encoding Video Stream, 2nd pass...\n"; +$status = system ("mencoder $vob_tempfile -ovc lavc -lavcopts vpass=2:vcodec=mpeg4:vbitrate=$video_bitrate:vhq -oac copy -o $avi_filename 1>/dev/tty8 2>/dev/tty8"); +die "Encoding Video Stream failed. mencoder exited with Status Code $?" unless $status == 0; + +print "finished encoding\n"; + + +if ($writecd) { + print "Now writing CD-Rom\n"; + $status = system("mkisofs -r -J $avi_filename | cdrecord speed=$speed dev=$writedev -data - 2>/dev/tty8 1>/dev/tty8"); + die "Writing CD failed. cdrecord exited with Status Code $?" unless $status == 0; +} +delete_tempfiles(); + +print "Finished - have a nice day ;-)\n"; +if ($shutdown) { + system("halt"); + exit; +} +exit; + + + + + + + + --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/TOOLS/divx2svcd +++ mplayer-0.99+1.0pre7try2+cvs20060117/TOOLS/divx2svcd @@ -0,0 +1,369 @@ +#!/bin/bash + +# (c) 2003 Vajna Miklos +# divx2svcd for MPlayer +# distributed under GPL License + +# simple utility that creates a SVCD from a video in an AVI container + +# The newest version of this utility can be found at +# http://vmiklos.uw.hu/divx2svcd/divx2svcd +# MPlayer available at +# http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.0pre3try2.tar.bz2 + +###changelog### +#nobody cares about it :-) +cat >/dev/null < +- support for toolame instead of mp2enc +- suppert for libavcodec mpeg2video codec instead of mpeg2enc + +0.2 +- support for tcmplex instead of mplex + +0.1rc2-rc4 +- small bugfixes + +0.1rc1 +- initial release + +EOF + + +###preparing### +#help + +function usage() +{ + cat </dev/null 2>&1 +bcbin=`which bc 2>/dev/null` +if [ $? != 0 ]; then + cat </dev/null 2>&1 +bcbin=`which vcdimager 2>/dev/null` +if [ $? != 0 ]; then + cat </dev/null 2>&1 +if [ $? = 0 ]; then + tcp_path=`which tcmplex-panteltje 2>&1` +else + tcp_path="x" +fi +which tcmplex >/dev/null 2>&1 +if [ $? = 0 ]; then + tc_path=`which tcmplex 2>&1` +else + tc_path="x" +fi + +if [ -x $tcp_path ]; then + tcbin=tcmplex-panteltje + tcopt=-0 +elif [ -x $tc_path ]; then + tcbin=tcmplex + tcopt=-p +else + cat </dev/null 2>&1 +cdrbin=`which cdrecord 2>/dev/null` +if [ $? != 0 ]; then + cat <= 2.01a14 + echo -n "Checking for cdrecord version >= 2.01a14... " + $cdrbin cuefile=a 2>&1 |grep 'Bad Option' >/dev/null 2>&1 + if [ "$?" == 0 ]; then + cat <= 2.01a14. You can download it at +ftp://ftp.berlios.de/pub/cdrecord/alpha/cdrtools-2.01a20.tar.gz +EOF + else + echo "`$cdrbin -version |cut -d ' ' -f 2`" + fi +fi +fi + +#checking for sub avariable + +if [ -f "$nev.sub" ]; then + subopts=$nev.sub +else + subopts='' +fi + +if [ "x$subopts" == "x" ]; then + subs='' +else + subs='-sub ' +fi + +#checking for what height needed +inputwidth=`mplayer -vo null -ao null "$input" -frames 1 2>/dev/null |grep '=>'|cut -d ' ' -f 5|cut -d x -f 1` +inputheight=`mplayer -vo null -ao null "$input" -frames 1 2>/dev/null |grep '=>'|cut -d ' ' -f 5|cut -d x -f 2` +svcdaspect=`echo -e "scale=10\n1.596/($inputwidth/$inputheight)"|bc /dev/stdin` +height=`echo -e "scale=10\n$svcdaspect*480"|bc /dev/stdin|cut -d . -f 1` + +#checking for ratios less than 1.33 +istoohigh=`expr $height \> 577` +if [ "$istoohigh" = 1 ]; then + height=576 +fi + +#find out the vf options +if [ "$height" = 576 ]; then + vfopts='-vf scale=480:576' +else + #-vf processes filters in reverse order + exy=`echo -e "scale=10\n(576-$height)/2"|bc /dev/stdin|cut -d . -f 1` + vfopts="-vf scale=480:$height,expand=480:576:0:$exy:1" + echo "Using filter options: '$vfopts'" +fi + +#finish displaying informations +if [ "$burning" == 1 ]; then +#asking for cd +cat < template + $tcbin -i "$nev.m2v" $tcopt "$nev.mp2" -o "$nev.mpg" -m s -F template + rm template + rm "$nev.m2v" "$nev.mp2" +fi + +for i in *mpg +do + nev2=`basename "$i" .mpg` + #creating images + vcdimager -t svcd -c "$nev2.cue" -b "$nev2.bin" "$i" + #burning if needs + if [ "$burning" == 1 ]; then + if [ "$firstcd" != 1 ]; then + cat < +# This file comes under GPL, see http://www.gnu.org/copyleft/gpl.html for more +# information on it's licensing. +use strict; +my $mencoder="mencoder"; # Path to MEncoder (including binary name) + +die <<"EOF" unless @ARGV; +Menc2Pass: No arguments given! +Please give all usual encoding parameters you would give to mencoder, but leave +away the pass= suboption. +EOF + +for(my $i=1; $i<=2; $i++) { + my $parm=""; + foreach my $val (@ARGV) { + if($val =~ /-lavcopts/) { + $parm.="$val vpass=$i:"; + } elsif($val =~ /-(divx4)|(xvid)opts/) { + $parm.="$val pass=$i:"; + } else { + $parm.="$val "; + } + } + print "Running $mencoder $parm\n"; + system($mencoder,$parm) + and die "MEncoder pass $i failed!\n" +} + --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/TOOLS/calcbpp.pl +++ mplayer-0.99+1.0pre7try2+cvs20060117/TOOLS/calcbpp.pl @@ -0,0 +1,43 @@ +#!/usr/bin/perl -w + +use POSIX; + +sub round { + my $v = shift; + + return floor($v + 0.5); +} + +$raw_aspect = 720/576; + +if (scalar(@ARGV) < 4) { + print("Please provide a) the cropped but unscaled resolution (e.g. " . + "716x524), b) the aspect ratio (either 4/3 or 16/9 for most DVDs), " . + "c) the video bitrate in kbps (e.g. 800) and d) the movie's fps.\n"); + print("If your DVD is not encoded at 720x576 then change the \$raw_aspect" . + "variable at the beginning of this script.\n"); + exit(1); +} + +($unscaled_width, $unscaled_height) = split('x', $ARGV[0]); +$encoded_at = $ARGV[1]; +if ($encoded_at =~ /\//) { + my @a = split(/\//, $encoded_at); + $encoded_at = $a[0] / $a[1]; +} +$scaled_width = $unscaled_width * ($encoded_at / ($raw_aspect)); +$scaled_height = $unscaled_height; +$picture_ar = $scaled_width / $scaled_height; +($bps, $fps) = @ARGV[2, 3]; + +printf("Prescaled picture: %dx%d, AR %.2f\n", $scaled_width, $scaled_height, + $picture_ar); +for ($width = 720; $width >= 320; $width -= 16) { + $height = 16 * round($width / $picture_ar / 16); + $diff = round($width / $picture_ar - $height); + $new_ar = $width / $height; + $picture_ar_error = abs(100 - $picture_ar / $new_ar * 100); + printf("${width}x${height}, diff % 3d, new AR %.2f, AR error %.2f%% " . + "scale=%d:%d bpp: %.3f\n", $diff, $new_ar, $picture_ar_error, $width, + $height, ($bps * 1000) / ($width * $height * $fps)); +} --- mplayer-0.99+1.0pre7try2+cvs20060117.orig/TOOLS/subedit.pl +++ mplayer-0.99+1.0pre7try2+cvs20060117/TOOLS/subedit.pl @@ -0,0 +1,445 @@ +#!/usr/bin/perl -w + +# A script for pipelined editing of subtitle files. +# Copyright (C) 2004 Michael Klepikov +# +# Version 1.0 initial release 28-Mar-04 +# +# Comments, suggestions -- send me an mail, but the recommended way is +# to enhance/fix on your own and submit to the distribution;) +# If you like, I can review the fixes. +# +# This script is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# Retain original credits when modifying. +# +# This script is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +use Math::BigInt; + +# Constants +my $FMT_UNKNOWN = 0; +my $FMT_SRT = 1; + +# Argument values +my $DEBUG = 0; +my $inFormat; +my $outFormat; +my $shiftMilli; +my $scaleMilli; +my $splitFromMilli; +my $splitToMilli; + +## Process command line +while (defined ($argVal = shift)) { + if ($argVal eq "-d" || $argVal eq "--debug") { + $DEBUG = 1; + } elsif ($argVal eq "-if" || $argVal eq "--input-format") { + $inFormat = shift; + usage ("Must specify input format") if ! $inFormat; + if ($inFormat =~ /^srt/i) { + $inFormat = $FMT_SRT; + } else { + usage ("Invalid input format"); + } + } elsif ($argVal eq "-of" || $argVal eq "--output-format") { + $outFormat = shift; + usage ("Must specify input format") if ! $outFormat; + if ($outFormat =~ /^srt/i) { + $outFormat = $FMT_SRT; + } else { + usage ("Invalid output format"); + } + } elsif ($argVal eq "-s" || $argVal eq "--shift") { + my $argTime = shift; + if (! defined $argTime || + ! defined ($shiftMilli = getTimeMillis ($argTime))) { + usage ("Invalid shift time value"); + } + } elsif ($argVal eq "-c" || $argVal eq "--scale") { + my $argTime = shift; + if (! defined $argTime || + ! defined ($scaleMilli = getTimeMillis ($argTime))) { + usage ("Invalid scale time value"); + } + } elsif ($argVal eq "-f" || $argVal eq "--split-from") { + my $argTime = shift; + if (! defined $argTime || + ! defined ($splitFromMilli = getTimeMillis ($argTime))) { + usage ("Invalid split start time value"); + } + } elsif ($argVal eq "-t" || $argVal eq "--split-to") { + my $argTime = shift; + if (! defined $argTime || + ! defined ($splitToMilli = getTimeMillis ($argTime))) { + usage ("Invalid split end time value"); + } + } elsif ($argVal eq "-h" || $argVal eq "--help") { + usage (); + } else { + usage ("Unrecognized argument $argVal"); + } +} + +# Input format defaults to SRT +$inFormat = $FMT_SRT if (! defined $inFormat); +# Output format defaults to the same as input +$outFormat = $inFormat if (! defined $outFormat); + +## Read + +my $subs; +if ($inFormat == $FMT_SRT) { + $subs = readSRT (*STDIN); + printf STDERR ("Read %d SRT subs\n", scalar @{$subs}) if $DEBUG; + # Sort by start time + @{$subs} = sort {$a -> {srtStartTime} <=> $b -> {srtEndTime}} @{$subs}; +} + +## Transform + +if (defined $shiftMilli && 0 != $shiftMilli) { + printf STDERR ("Shift: %d milliseconds\n", $shiftMilli) if $DEBUG; + shiftSRT ($subs, $shiftMilli); +} + +if (defined $splitFromMilli || defined $splitToMilli) { + if ($DEBUG) { + my $printFrom = (defined $splitFromMilli) ? $splitFromMilli : "-"; + my $printTo = (defined $splitToMilli) ? $splitToMilli : "-"; + printf STDERR ("Split: from $printFrom to $printTo\n"); + } + splitSRT ($subs, $splitFromMilli, $splitToMilli); +} + +if (defined $scaleMilli && 0 != $scaleMilli) { + my $lastSubIdx = scalar @{$subs} - 1; + if ($lastSubIdx >= 0) { + my $lastTimeOrig = $subs -> [$lastSubIdx] -> {srtEndTime}; + if ($lastTimeOrig == 0) { + die "Cannot scale when last subtitle ends at 00:00:00,000"; + } + my $lastTimeScaled = $lastTimeOrig + $scaleMilli; + printf STDERR ("Scale: %d/%d\n", $lastTimeScaled, $lastTimeOrig) if $DEBUG; + scaleSRT ($subs, $lastTimeScaled, $lastTimeOrig); + } +} + +## Write +if ($outFormat == $FMT_SRT) { + writeSRT (*STDOUT, $subs); +} + +# Close STDOUT, as recommended by Perl manual +# (allows diagnostics on disc overflow, etc.) +close (STDOUT) || die "Cannot close output stream: $!"; + +exit 0; + +## Subroutines + +# Convert string time format to milliseconds +# SRT style: "01:20:03.251", and "," is allowed instead of "." +# Return undef in case of format error +sub getTimeMillis +{ + $_ = shift; + my $millis = 0; + + if (/\s*(.*)[\.,]([0-9]+)?\s*$/) { # Fraction; strip surrounding spaces + #print STDERR "frac: \$1=$1 \$2=$2\n" if $DEBUG; + $_ = $1; + $millis += ("0." . $2) * 1000 if $2; + } + if (/(.*?)([0-9]+)$/) { # Seconds + #print STDERR "secs: \$1=$1 \$2=$2\n" if $DEBUG; + $_ = $1; + $millis += $2 * 1000 if $2; + } + if (/(.*?)([0-9]+):$/) { # Minutes + #print STDERR "mins: \$1=$1 \$2=$2\n" if $DEBUG; + $_ = $1; + $millis += $2 * 60000 if $2; + } + if (/(.*?)([0-9]+):$/) { # Hours + #print STDERR "mins: \$1=$1 \$2=$2\n" if $DEBUG; + $_ = $1; + $millis += $2 * 3600000 if $2; + } + if (/(.*?)\-$/) { # Minus sign + $_ = $1; + $millis *= -1; + } + $millis = undef if (! /^$/); # Make sure we ate everything up + if ($DEBUG) { + if (defined $millis) { + #print STDERR "time value match: $millis ms\n"; + } else { + #print STDERR "time mismatch\n"; + } + } + return $millis; +} + +# Convert milliseconds to SRT formatted string +sub getTimeSRT +{ + my $t = shift; + my $tMinus = ""; + if ($t < 0) { + $t = -$t; + $tMinus = "-"; + } + my $tMilli = $t % 1000; + $t /= 1000; + my $tSec = $t % 60; + $t /= 60; + my $tMin = $t % 60; + $t /= 60; + my $tHr = $t; + return sprintf ("%s%02d:%02d:%02d,%03d", + $tMinus, $tHr, $tMin, $tSec, $tMilli); +} + +# Read SRT subtitles +sub readSRT +{ + local *IN = shift; + my $subs = []; + + $_ = ; + print STDERR "Undefined first line\n" if ! defined $_ && $DEBUG; + my $lineNo = 1; + READ_SUBS: + while (defined $_) { + # Each loop iteration reads one subtitle from + my $sub = {}; + + # print STDERR "Reading line $lineNo\n" if $DEBUG; + + # Skip empty lines + while (/^\s*$/) { + last READ_SUBS if ! ($_ = ); + ++$lineNo; + } + + # Subtitle number + if (/^\s*([0-9]+)\s*$/) { + $sub -> {srtNumber} = $1; + # print "SRT num: $1\n" if $DEBUG; + } else { + die "Invalid SRT format at line $lineNo"; + } + + # Timing + if ($_ = ) { + ++$lineNo; + } else { + die "Unexpected end of SRT stream at line $lineNo"; + } + # print STDERR "LINE: $_\n" if $DEBUG; + if (/^\s*(\S+)\s*--\>\s*(\S+)\s*$/) { + my $startMillis = getTimeMillis ($1); + my $endMillis = getTimeMillis ($2); + die "Invalid SRT timing format at line $lineNo: $_" + if ! defined $startMillis || ! defined $endMillis; + $sub -> {srtStartTime} = $startMillis; + $sub -> {srtEndTime} = $endMillis; + } else { + die "Invalid SRT timing format at line $lineNo: $_"; + } + + # Text lines + my $subLines = []; + while (1) { + last if ! ($_ = ); # EOF ends subtitle + ++$lineNo; + last if /^\s*$/; # Empty line ends subtitle + ($_ = $_) =~ s/\s+$//; # Strip trailing spaces + push @{$subLines}, $_; + } + die "No text in SRT subtitle at line $lineNo" if 0 == scalar @{$subLines}; + $sub -> {lines} = $subLines; + + # Append subtitle to the list + push @{$subs}, $sub; + } + print STDERR "SRT read ok, $lineNo lines\n" if $DEBUG; + + return $subs; +} + +# Write SRT subtitles +sub writeSRT +{ + use integer; # For integer division + local *OUT = shift; + my $subs = shift; + + my $subNum = 0; + foreach (@{$subs}) { + ++$subNum; + + my $sub = $_; + my $sTimeSRT = getTimeSRT ($sub -> {srtStartTime}); + my $eTimeSRT = getTimeSRT ($sub -> {srtEndTime}); + printf OUT ("%d\n%s --> %s\n", $subNum, $sTimeSRT, $eTimeSRT); + foreach (@{$sub -> {lines}}) { + printf OUT ("%s\n", $_); + } + printf OUT "\n"; + } + printf STDERR ("Wrote %d SRT subs\n", $subNum) if $DEBUG; +} + +# Shift SRT subtitles by a given number of seconds. +# The number may be negative and fractional. +sub shiftSRT +{ + use integer; # $shiftMilli could be passed as float + my $subs = shift; + my $shiftMilli = shift; + + foreach (@{$subs}) { + $_ -> {srtStartTime} += $shiftMilli; + $_ -> {srtEndTime} += $shiftMilli; + } +} + +# Multiply each subtitle timing by a divident and divide by divisor. +# The idea is that the divident is usually the new total number of +# milliseconds in the subtitle file, and the divisor is the old +# total number of milliseconds in the subtitle file. +# We could simply use a double precision real coefficient instead of +# integer divident and divisor, and that could be good enough, but +# using integer arithmetics *guarantees* precision up to the last +# digit, so why settle for good enough when we can have a guarantee. +# +# Uses Math::BigInt arithmetics, because it works with numbers +# up to (total number of milliseconds for a subtitle timing)^2, +# which could be on the order of approximately 1e+13, which is +# larger than maximum 32-bit integer. +# There is a performance loss when using BigInt vs. regular floating +# point arithmetics, but the actual performance is quite acceptable +# on files with a few thousand subtitles. +sub scaleSRT +{ + use integer; # Divident and divisor could be passed as floats, truncate + my $subs = shift; + my $scaleDividend = shift; + my $scaleDivisor = shift; + + foreach (@{$subs}) { + my $ss = Math::BigInt -> new ($_ -> {srtStartTime}); + $ss = $ss -> bmul ($scaleDividend); + $_ -> {srtStartTime} = $ss -> bdiv ($scaleDivisor) -> bsstr (); + my $se = Math::BigInt -> new ($_ -> {srtEndTime}); + $se = $se -> bmul ($scaleDividend); + $_ -> {srtEndTime} = $se -> bdiv ($scaleDivisor) -> bsstr (); + } +} + +# Extract a fragment within a given time interval +# Either "from" or "to" may be undefined +sub splitSRT +{ + use integer; # fromMilli and toMilli could be passed as floats, truncate + my $subs = shift; + my $fromMilli = shift; + my $toMilli = shift; + + my $iSub = 0; + while ($iSub < scalar @{$subs}) { + $_ = $subs -> [$iSub]; + my $keep = 0; + if (! defined $fromMilli || $_ -> {srtEndTime} >= $fromMilli) { + # The subtitle ends later than the start boundary + + # Fix overlapping start timing, + # but only of the start boundary is not infinite (undef) + if (defined $fromMilli && $_ -> {srtStartTime} < $fromMilli) { + $_ -> {srtStartTime} = $fromMilli; + } + if (! defined $toMilli || $_ -> {srtStartTime} <= $toMilli) { + # The subtitle begins earlier than the end boundary + + # Fix overlapping end timing, + # but only of the end boundary is not infinite (undef) + if (defined $toMilli && $_ -> {srtEndTime} > $toMilli) { + $_ -> {srtEndTime} = $toMilli; + } + + # All conditions met, all fixes done + $keep = 1; + } + } + if ($keep) { + ++$iSub; + } else { + splice @{$subs}, $iSub, 1; + } + } +} + +# Print brief usage help +# Accepts an optional error message, e.g. for errors parsing command line +sub usage +{ + my $msg = shift; + my $exitCode = 0; + + if (defined $msg) { + $exitCode = 2; + print STDERR "$msg\n"; + } + + print STDERR < input format; supported: SRT + default is SRT + -of,--output-format output format; supported: SRT + default is same as input format + -s,--shift