building MPlayer-1.0rc4 on openbsd 5.0
首先,建议使用openbsd 的package安装,而不是从源码编译,除非里面的mplayer确实不适用。 source file: http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc2.tar.bz2 编译之前,先下载:
http://www2.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2
然后解压至/usr/local/lib/codecs文件夹
configure选项: —codecsdir=/usr/local/lib/codecs —extra-cflags=-I/usr/local/include —extra-ldflags=-L/usr/local/lib gmake && gmake install #(gmake, not make) 如果出现: network.h:69: error: redefinition of ‘struct sockaddr_storage’ 编辑 libavformat/network.h文件,在文件前面添加: #define HAVE_STRUCT_SOCKADDR_STORAGE 1 在AMD64平台上,你可能会遇到下面的错误:
{standard input}: Assembler messages:
{standard input}:18: Error: `ff_h264_lps_range(%eax,%esi,2)' is not a valid 64 bit base/index expression
{standard input}:28: Error: `ff_h264_norm_shift(%esi)' is not a valid 64 bit base/index expression
{standard input}:30: Error: `ff_h264_mlps_state+128(%eax)' is not a valid 64 bit base/index expression
{standard input}:42: Error: `-1(%ebx)' is not a valid 64 bit base/index expression
......
一个临时的解决方案是:
在 libavcodec/h264.h顶部加入;
#define HAVE_EBX_AVAILABLE 0
参考:<a href="http://web.archiveorange.com/archive/v/bFtHWRep6AGOQUhfzoHN">http://web.archiveorange.com/archive/v/bFtHWRep6AGOQUhfzoHN</a>
如果编译失败,可能是系统上一些codec没有安装,可参考: http://www.vimp.com/en/documentation-faq-article/items/compile-mplayermencoder-on-your-own.html