multimedia/MPlayer: Updated for version 1.0rc2

This commit is contained in:
Robby Workman 2010-05-11 19:45:30 +02:00 committed by Michiel van Wessem
parent 61474172f8
commit 281164c4d9
13 changed files with 198 additions and 130 deletions

Binary file not shown.

View File

@ -2,7 +2,7 @@
# Slackware build script for MPlayer
# Copyright 2006-2007 Robby Workman (http://rlworkman.net)
# Copyright 2006-2008 Robby Workman, Northport, AL, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@ -26,16 +26,18 @@
# Thanks to Eric Hameleers for suggestions (and some code examples) :)
PRGNAM=MPlayer
VERSION=1.0rc1
PKGVERSION=$VERSION # This may change later in the script
VERSION=1.0rc2
ARCH=${ARCH:-custom}
BUILD=${BUILD:-1}
BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
PKGVERSION=$VERSION # This may change later in the script
# If you installed the codecs package according to the instructions at
# the MPlayer website, you'll probably want to change this variable
# to /usr/local/lib/codecs. Otherwise, you'll want to leave it alone
@ -63,31 +65,38 @@ OSDFONTS="Arialuni.ttf arial.ttf DejaVuSans.ttf Vera.ttf"
# when running the script: LANGUAGES=en ./MPlayer.SlackBuild
LANGUAGES=${LANGUAGES:-"en nl fr de es"}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP || exit 1
cd $TMP
rm -rf $PRGNAM-$VERSION
tar -xjvf $CWD/$PRGNAM-$VERSION.tar.bz2 || exit 1
cd $PRGNAM-$VERSION || exit 1
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R a-s,u+rw,go+r-w .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
# Fix a security problem and increment package version to try2
# http://www.debian.org/security/2006/dsa-1244
patch -p0 < $CWD/asmrules_fix_20061231.diff || exit 1
PKGVERSION=${VERSION}try2
# Apply some *almost* official patches. To clarify, the actual work done
# by the patch is identical to the official patches released by upstream.
# I just reworked them to apply from the toplevel source directory with -p1
# --rworkman
# Fix buffer overflow in url.c
patch -p1 < $CWD/url_fix_20080120.diff
# Fix buffer overflow in stream_cddb.c
patch -p1 < $CWD/stream_cddb_fix_20080120.diff
# Fix stack overflow in demux_audio.c
patch -p1 < $CWD/demux_audio_fix_20080129.diff
# Fix buffer overflow in demux_mov.c
patch -p1 < $CWD/demux_mov_fix_20080129.diff
# Fix a security problem and increment package version to try3
# http://secunia.com/product/2255/
# http://svn.mplayerhq.hu/mplayer/trunk/stream/stream_cddb.c?r1=23287&r2=23470&diff_format=u
patch -p1 < $CWD/stream.cddb_fix_20070606.diff || exit 1
PKGVERSION=${VERSION}try3
# Patch to account for linux-2.6.24.x including ivtv, but MPlayer won't
# build against it. See this link for more information and patch origin:
# http://archives.free.net.ph/message/20080201.201454.1047775e.en.html
patch -p1 < $CWD/ivtv_fix-2.6.24.x.diff
# The MPlayer developers will not support and/or deal with bug reports
# if you don't allow it to automatically determine compiler flags,
@ -95,20 +104,21 @@ PKGVERSION=${VERSION}try3
CFLAGS= \
./configure \
--prefix=/usr \
--mandir=/usr/man \
--confdir=/etc/mplayer \
--enable-color-console \
--enable-gui \
--enable-menu \
--enable-runtime-cpudetection \
--enable-largefiles \
--with-codecsdir="$CODECSDIR" \
--language="$LANGUAGES" \
|| exit 1
--codecsdir="$CODECSDIR" \
--language="$LANGUAGES"
make || exit 1
make install DESTDIR=$PKG || exit 1
make
make install DESTDIR=$PKG
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
)
@ -119,10 +129,10 @@ make install DESTDIR=$PKG || exit 1
mkdir -p $PKG/usr/share/mplayer/skins
if [ -r $CWD/$THEME-$THEME_VERSION.tar.bz2 ]; then
( cd $PKG/usr/share/mplayer/skins
tar -xjf $CWD/$THEME-$THEME_VERSION.tar.bz2
ln -s $THEME default
) || exit 1
cd $PKG/usr/share/mplayer/skins
tar xf $CWD/$THEME-$THEME_VERSION.tar.bz2
ln -s $THEME default
cd -
else
echo A usable theme tarball does not appear to exist in $CWD
echo \(or you didn't edit the script to reflect it, or something
@ -137,14 +147,10 @@ else
fi
fi
# Fix path to icon in desktop file so that the icon will display in kde
sed -i 's%Icon=mplayer.xpm%Icon=/usr/share/pixmaps/mplayer.xpm%' \
$PKG/usr/share/applications/mplayer.desktop || exit 1
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a AUTHORS ChangeLog Copyright LICENSE README DOCS/* \
$PKG/usr/doc/$PRGNAM-$VERSION
cp -a AUTHORS Copyright LICENSE README DOCS $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
rm -rf $PKG/usr/doc/$PRGNAM-$VERSION/DOCS/man
# Don't clobber an existing config file
cat etc/example.conf > $PKG/etc/mplayer/mplayer.conf.new
@ -153,15 +159,15 @@ mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
# We'll link to one of the standard ttf fonts defined above
# Thanks to Eric Hameleers for this code snippet
# We'll link to one of the standard ttf fonts defined above.
# Thanks to Eric Hameleers for this code snippet and permission to use it.
cat << EOF >> $PKG/install/doinst.sh
# Symlink a default TrueType font for OSD:
if [ ! -f usr/share/mplayer/subfont.ttf ]; then
for font in $OSDFONTS ; do
if [ -f usr/X11R6/lib/X11/fonts/TTF/\$font ]; then
if [ -f usr/share/fonts/TTF/\$font ]; then
( cd usr/share/mplayer
ln -fs /usr/X11R6/lib/X11/fonts/TTF/\$font subfont.ttf
ln -fs /usr/share/fonts/TTF/\$font subfont.ttf
)
break
fi

View File

@ -1,8 +1,8 @@
PRGNAM="MPlayer"
VERSION="1.0rc1"
VERSION="1.0rc2"
HOMEPAGE="http://www.mplayerhq.hu/"
DOWNLOAD="http://www4.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc1.tar.bz2"
MD5SUM="18c05d88e22c3b815a43ca8d7152ccdc"
DOWNLOAD="http://www3.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc2.tar.bz2"
MD5SUM="7e27e535c2d267637df34898f1b91707"
MAINTAINER="Robby Workman"
EMAIL="rw@rlworkman.net"
APPROVED="BP{k}"

View File

@ -12,7 +12,7 @@ running the SlackBuild script).
This script is written to install the default "Blue" theme for MPlayer, and
it will print an error (but allow you to continue) if you don't have the
theme tarball in the build directory. You can obtain the Blue theme here:
http://www.mplayerhq.hu/MPlayer/skins/Blue-1.7.tar.bz2
http://www.mplayerhq.hu/MPlayer/skins/Blue-1.7.tar.bz2
If you want to install some other theme, the script is written to support
that, but other themes have not been tested with it. The best option for
using additional themes/skins is to install them in $HOME/.mplayer by

View File

@ -1,51 +0,0 @@
Index: stream/realrtsp/asmrp.c
===================================================================
--- stream/realrtsp/asmrp.c (revision 20381)
+++ stream/realrtsp/asmrp.c (working copy)
@@ -40,6 +40,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#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++;
Index: stream/realrtsp/real.c
===================================================================
--- stream/realrtsp/real.c (revision 20381)
+++ stream/realrtsp/real.c (working copy)
@@ -271,7 +271,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);
Index: stream/realrtsp/asmrp.h
===================================================================
--- stream/realrtsp/asmrp.h (revision 20381)
+++ stream/realrtsp/asmrp.h (working copy)
@@ -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

View File

@ -0,0 +1,12 @@
diff -Nur MPlayer-1.0rc2.orig/libmpdemux/demux_audio.c MPlayer-1.0rc2/libmpdemux/demux_audio.c
--- MPlayer-1.0rc2.orig/libmpdemux/demux_audio.c 2008-02-01 09:57:58.058713289 -0600
+++ MPlayer-1.0rc2/libmpdemux/demux_audio.c 2008-02-01 09:57:07.479830963 -0600
@@ -229,6 +229,8 @@
ptr += 4;
comment = ptr;
+ if (&comment[length] < comments || &comment[length] >= &comments[blk_len])
+ return;
c = comment[length];
comment[length] = 0;

View File

@ -0,0 +1,46 @@
diff -Nur MPlayer-1.0rc2.orig/libmpdemux/demux_mov.c MPlayer-1.0rc2/libmpdemux/demux_mov.c
--- MPlayer-1.0rc2.orig/libmpdemux/demux_mov.c 2007-10-07 14:49:33.000000000 -0500
+++ MPlayer-1.0rc2/libmpdemux/demux_mov.c 2008-02-01 10:02:10.217082975 -0600
@@ -173,11 +173,12 @@
i=trak->chunkmap_size;
while(i>0){
--i;
- for(j=trak->chunkmap[i].first;j<last;j++){
+ j=FFMAX(trak->chunkmap[i].first, 0);
+ for(;j<last;j++){
trak->chunks[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
@@ -235,6 +236,8 @@
s=0;
for(j=0;j<trak->durmap_size;j++){
for(i=0;i<trak->durmap[j].num;i++){
+ if (s >= trak->samples_size)
+ break;
trak->samples[s].pts=pts;
++s;
pts+=trak->durmap[j].dur;
@@ -246,6 +249,8 @@
for(j=0;j<trak->chunks_size;j++){
off_t pos=trak->chunks[j].pos;
for(i=0;i<trak->chunks[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,
@@ -1568,8 +1573,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;
}
}

View File

@ -1,11 +1,11 @@
config() {
NEW="$1"
OLD="`dirname $NEW`/`basename $NEW .new`"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
# If there's no config file by that name, mv it over:
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then
elif [ "$(cat $OLD|md5sum)" = "$(cat $NEW|md5sum)" ]; then
# toss the redundant copy
rm $NEW
fi

View File

@ -0,0 +1,33 @@
Patch to account for linux-2.6.24.x including ivtv, but MPlayer won't
build against it. See this link for more information and the origin
of the patch:
http://archives.free.net.ph/message/20080201.201454.1047775e.en.html
<rworkman@slackbuilds.org>
diff -Nur MPlayer-1.0rc2.orig/configure MPlayer-1.0rc2/configure
--- MPlayer-1.0rc2.orig/configure 2007-10-07 14:49:33.000000000 -0500
+++ MPlayer-1.0rc2/configure 2008-03-09 23:38:20.998568493 -0500
@@ -4920,7 +4920,7 @@
echores "$_dxr3"
-echocheck "IVTV TV-Out"
+echocheck "IVTV TV-Out (pre linux-2.6.24)"
if test "$_ivtv" = auto ; then
cat > $TMPC << EOF
#include <stdlib.h>
@@ -4928,7 +4928,13 @@
#include <linux/types.h>
#include <linux/videodev2.h>
#include <linux/ivtv.h>
-int main(void) { return 0; }
+#include <sys/ioctl.h>
+int main(void) {
+struct ivtv_cfg_stop_decode sd;
+struct ivtv_cfg_start_decode sd1;
+ioctl (0, IVTV_IOC_START_DECODE, &sd1);
+ioctl (0, IVTV_IOC_STOP_DECODE, &sd);
+return 0; }
EOF
_ivtv=no
cc_check && _ivtv=yes

View File

@ -1,3 +1,11 @@
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler-----------------------------------------------------|
MPlayer: MPlayer Media player for linux
MPlayer:
MPlayer: Media player for linux (runs on many other Unices, and non-x86
@ -7,5 +15,5 @@ MPlayer: YUV4MPEG, FILM, RoQ, PVA files, supported by many native, XAnim,
MPlayer: and Win32 DLL codecs. You can watch VideoCD, SVCD, DVD, 3ivx,
MPlayer: DivX 3/4/5 and even WMV movies, too (without the avifile library).
MPlayer:
MPlayer:
MPlayer: Homepage: http://www.mplayerhq.hu
MPlayer:

View File

@ -1,30 +0,0 @@
--- trunk/stream/stream_cddb.c 2007/05/10 11:43:39 23287
+++ trunk/stream/stream_cddb.c 2007/06/05 11:13:32 23470
@@ -377,7 +377,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;
@@ -438,7 +438,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;
@@ -475,7 +475,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;

View File

@ -0,0 +1,33 @@
diff -Nur MPlayer-1.0rc2.orig/stream/stream_cddb.c MPlayer-1.0rc2/stream/stream_cddb.c
--- MPlayer-1.0rc2.orig/stream/stream_cddb.c 2007-10-07 14:49:26.000000000 -0500
+++ MPlayer-1.0rc2/stream/stream_cddb.c 2008-02-01 10:06:49.913021939 -0600
@@ -53,6 +53,7 @@
#include "version.h"
#include "stream.h"
#include "network.h"
+#include "libavutil/intreadwrite.h"
#define DEFAULT_FREEDB_SERVER "freedb.freedb.org"
#define DEFAULT_CACHE_DIR "/.cddb/"
@@ -453,8 +454,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;
@@ -490,8 +492,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);

View File

@ -0,0 +1,11 @@
diff -Nur MPlayer-1.0rc2.orig/stream/url.c MPlayer-1.0rc2/stream/url.c
--- MPlayer-1.0rc2.orig/stream/url.c 2007-10-07 14:49:26.000000000 -0500
+++ MPlayer-1.0rc2/stream/url.c 2008-02-01 10:04:09.851900575 -0600
@@ -328,6 +328,7 @@
}
}
+ tmp = NULL;
while(i < len) {
// look for the next char that must be kept
for (j=i;j<len;j++) {