Sabayon Linux 安装 MPlayer-1.0rc3

rikeyone 2012-07-22

因为安装的PPSteam不能播放视频。怀疑是mplayer的问题。在网上找打PPS官网有一个针对MPlayer-1.0rc3的补丁文件mplayer.patch,决定试一试。

我在mplayer官网上下载的MPlayer-1.0rc3源码,最新的源码是MPlayer-1.1。我是过了,MPlayer-1.1安装起来相当顺利,./configure  make&&make install 就直接装上了。但是MPlayer-1.0rc3却非常费劲。不管有没有打这个PPS的补丁……

首先下载补丁,补丁文件是从PPS官网上下载的mplayer.patch,将其放到当前工作路径/home,

然后,下载MPlayer-1.0rc3.tar.bz2的源码,将其下载到/home,

之后解压 

@home: tar -xvf MPlayer-1.0rc3.tar.bz2

首先,下载MPlayer-1.0rc3.tar.bz2的源码(http://www.mplayerhq.hu/MPlayer/releases/),

之后解压 

tar -xvf MPlayer-1.0rc3.tar.bz2

这样,/home 之中就有pps的补丁和一个文件夹MPlayer-1.0rc3了,接下来,安装pps官网的安装方法(http://download.ppstream.com/linux/readme.txt),改一下MPlayer源码的文件夹名称

@home: mv MPlayer-1.0rc3 MPlayer-PPS

就在当前路径/home下运行

patch -p1 < mplayer.patch
这样,补丁就打好了。

另外,mplayer还要下载Codecs,也是从MPlayer官网上下载(http://www.mplayerhq.hu/MPlayer/releases/codecs/),我下载的是all-20110131.tar.bz2。然后将其复制到/usr/share/codes目录,这个目录没有就新建一个。然后在这个目录/usr/share/codecs内,解压all-20110131.tar.bz2。

#codecs: tar -xvf all-20110131.tar.bz2 

然后,进入到MPlayer-PPS路径内,运行configure

@home: cd MPlayer-PPS

@MPlayer-PPS: ./configure --prefix=/usr --confdir=/etc/mplayer --enable-largefiles --enable-x11 --disable-gui --codecsdir=/usr/share/codecs/  --language=zh_CN --disable-png --disable-live

编译:

@MPlayer-PPS:  make

出错,提示

libvo/vo_png.c:56:28: error: 'Z_NO_COMPRESSION' undeclared here (not in a function)
libvo/vo_png.c: In function 'create_png':
libvo/vo_png.c:160:9: error: dereferencing pointer to incomplete type
make: *** [libvo/vo_png.o] 错误 1

在网上四处查,发现一个网页(http://web.archiveorange.com/archive/v/p5L0wrMay1Zd2MYPKlOH 和http://lists.mplayerhq.hu/pipermail/mplayer-users/2007-July/068163.html 这个貌似是正解,但是没有搞懂怎么弄),与另一个网页(http://lists.mplayerhq.hu/pipermail/mplayer-users/2007-July/068162.html这个网页提到了个办法,可以通过加 --disable-png 让编译通过)

于是,再试

@MPlayer-PPS:  make distclean

@MPlayer-PPS:  ./configure --codecsdir=/usr/share/codecs/ --disable-png

@MPlayer-PPS:  make

原来的错误总算没有了,但是仍然有其他错误:

libmpdemux/demux_rtp.cpp:79:20: error: 'class RTSPClient' has no member named 'describeWithPassword'
libmpdemux/demux_rtp.cpp:81:20: error: 'class RTSPClient' has no member named 'describeURL'
libmpdemux/demux_rtp.cpp: In function 'demuxer_t* demux_open_rtp(demuxer_t*)':
libmpdemux/demux_rtp.cpp:123:61: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
/usr/include/liveMedia/RTSPClient.hh:36:22: error:   initializing argument 2 of 'static RTSPClient* RTSPClient::createNew(UsageEnvironment&, const char*, int, const char*, portNumBits)' [-fpermissive]
libmpdemux/demux_rtp.cpp:123:61: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
/usr/include/liveMedia/RTSPClient.hh:36:22: error:   initializing argument 3 of 'static RTSPClient* RTSPClient::createNew(UsageEnvironment&, const char*, int, const char*, portNumBits)' [-fpermissive]
libmpdemux/demux_rtp.cpp:213:21: error: 'class RTSPClient' has no member named 'setupMediaSubsession'
libmpdemux/demux_rtp.cpp:225:24: error: 'class RTSPClient' has no member named 'playMediaSession'
libmpdemux/demux_rtp.cpp: In function 'void teardownRTSPorSIPSession(RTPState*)':
libmpdemux/demux_rtp.cpp:586:27: error: 'class RTSPClient' has no member named 'teardownMediaSession'
libmpdemux/demux_rtp.cpp: In function 'char* openURL_rtsp(RTSPClient*, const char*)':
libmpdemux/demux_rtp.cpp:83:1: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [libmpdemux/demux_rtp.o] 错误 1

晕,网上搜,找到https://bugs.archlinux.org/task/28759 里面也有一个折衷方法,加--disable-live 参数,接着试

@MPlayer-PPS:  make distclean

@MPlayer-PPS:  ./configure --codecsdir=/usr/share/codecs/ --disable-png --disable-live

@MPlayer-PPS:  make

就通过了,之后安装

@MPlayer-PPS: sudo make install


P.S.

看到网上有人安装mplayer,配置的参数是 ./configure --prefix=/usr --confdir=/etc/mplayer --enable-largefiles --enable-x11 --enable-gui --codecsdir=/usr/share/codecs/  --language=zh_CN 

尝试,发现也会有错

MPlayer Error: The GUI requires GTK devel packages (which were not found).

这时候要吧GUI选项去掉或者改成 --diable-gui 才能行。

相关推荐