mpalyer 编译错误解决办法

时间:2022-08-31 14:47:41

 

错误(1)
./codec-cfg ./etc/codecs.conf > codecs.conf.h
./codec-cfg: 1: Syntax error: word unexpected (expecting ")")
解决方法:在configure时添加 --host-cc=gcc就可以解决

错误(2)
make[1]: *** [armv4l/dsputil_arm_s.o] Error 1
make[1]: Leaving directory `/root/MPlayer-1.0rc2/libavcodec'
make: *** [libavcodec/libavcodec.a] 错误 2
错误原因是pld指令只在armv5te以上版本有效,在2440(armv4l)无效
预读取PLD指令
功能:cache预读取(PLD,PreLoad),使用PLD指示存储系统从后面几条指令所指定的存储器地址读取,存储系统可使用这种方法加速以后的存储器访问。
解决方法:修改MPlayer-1.0rc2/libmpeg2/motion_comp_arm_s.S和MPlayer-1.0rc2 /libavcodec/armv4l/dsputil_arm_s.S这两个报错文件,在前面添加上:
#ifndef HAVE_PLD
.macro pld reg
.endm
#endif
然后再make

 

 

mplayer编译过程中出现ivtv错误

+-------------------------------------
vo_ivtv.c: In function 'ivtv_reset':
vo_ivtv.c:79: error: storage size of 'sd' isn't known
vo_ivtv.c:80: error: storage size of 'sd1' isn't known
vo_ivtv.c:84: error: 'IVTV_STOP_FL_HIDE_FRAME' undeclared (first use in this function)
vo_ivtv.c:84: error: (Each undeclared identifier is reported .ly .ce
vo_ivtv.c:84: error: for each function it appears in.)
vo_ivtv.c:87: error: 'IVTV_IOC_STOP_DECODE' undeclared (first use in this function)
vo_ivtv.c:97: error: 'IVTV_IOC_START_DECODE' undeclared (first use in this function)
vo_ivtv.c:80: warning: unused variable 'sd1'
vo_ivtv.c:79: warning: unused variable 'sd'
make[1]: *** [vo_ivtv.o] Error 1
make[1]: Leaving directory `/data1/wdy-tools/smplayer/MPlayer-1.0rc2/libvo'
make: *** [libvo/libvo.a] Error 2
+-------------------------------------

解决方法,在 安装 MPlayer时: ./configure --disable-ivtv

随便找了找,用了configure 参数如下:
./configure --codecsdir=/usr/lib/codecs --enable-gui --enable-menu --prefix=/opt --mandir=/usr/share/man --win32codecsdir=/usr/lib/win32 --enable-largefiles --disable-tv --enable-freetype --disable-inet6 --enable-gl --enable-xv --enable-x11 --disable-ivtv

然后冒出一个错误,The GUI requires libavcodec with PNG support (needs zlib).
找了N久,网上都说需要“sudo apt-get install libavcodec-dev”就可以了,libavcodec-dev会将zlib装好的,我用了,不行。然后又去找zlib在ubuntu下到底是个 什么名字,就是这个"zlib1g-dev",我已经装好的。libpng12-dev也装好了。

最好只好找configure.log,其实我都翻了几遍了,可是从文件最后根本看不出什么端倪,不过这次我搜索了configure.log中的 zlib,然后发现这么一句“/usr/bin/ld: cannot find -lXv”,然后真相大白,是libXv.so没有,于是“sudo apt-get install libxv-dev",configure通过。

1. The GUI requires libavcodec with PNG support (needs zlib).
solution:
sudo apt-get install zlib1g-dev
sudo apt-get install libxv-dev

2. vo_ivtv.c: In function 'ivtv_reset':
vo_ivtv.c:79: error: storage size of 'sd' isn't known
vo_ivtv.c:80: error: storage size of 'sd1' isn't known
vo_ivtv.c:84: error: 'IVTV_STOP_FL_HIDE_FRAME' undeclared (first use in this
function)

solution:
because i don't want ivtv used on my pc, so i use --disable-ivtv to reconfigure it.

3. undefined reference to `video_out_ivtv'
collect2: ld returned 1 exit status

solution:
in file libvo/video_out.c, where
#ifdef HAVE_DXR2
extern vo_functions_t video_out_dxr2;
#endif
extern vo_functions_t video_out_dxr3; // ошибка сделана тут
#ifdef HAVE_IVTV
extern vo_functions_t video_out_ivtv;
#endif

edit it like this:
#ifdef HAVE_DXR2
extern vo_functions_t video_out_dxr2;
#endif
#ifdef HAVE_DXR3
extern vo_functions_t video_out_dxr3; / / Added patch HAVE_DXR3 because that is not compiling mplayer
#endif
#ifdef HAVE_IVTV
extern vo_functions_t video_out_ivtv;
#endif

 

 

 

 

 

 

 

mplayer破坏.  
 修改源码:
    libavcodec/bitstream.h:181行 
     加入如下语句.
 -------------------------------------------------  
#if defined(ARCH_ARMV4L)
typedef  int32_t intptr_t ; /* Add by Andrew Huang*/
#endif
--------------------------------------------------- 
   否则将会有如下编译错误
   编译错误:
   arm-linux-gcc -I../libswscale -I../libavcodec  -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE -I.. -I.. -I../libavutil -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -I. -I.. -I../libavutil -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4   -pipe -ffast-math -fomit-frame-pointer -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DHAVE_CONFIG_H -I/usr/X11R6/include   -c -o cyuv.o cyuv.c
    cc1: warning: include location "/usr/X11R6/include" is unsafe for cross-compilation
In file included from mpegvideo.h:32,
                 from cyuv.c:38:
bitstream.h: In function ''put_bits'':
bitstream.h:233: error: ''intptr_t'' undeclared (first use in this function)
bitstream.h:233: error: (Each undeclared identifier is reported only once
bitstream.h:233: error: for each function it appears in.)
bitstream.h:233: error: expected '')'' before ''s''
bitstream.h: In function ''init_get_bits'':
bitstream.h:777: error: ''intptr_t'' undeclared (first use in this function)
bitstream.h:777: error: expected '')'' before ''buffer''
bitstream.h:778: error: expected '')'' before ''buffer''
make[1]: *** [cyuv.o] Error 1

 

1.修改源码 libavcodec/armv4l/dsputil_arm_s.S, motion_comp_arm_s.S
在其开始的加入
-------------------------
#ifndef HAVE_PLD
.macro pld reg
.endm
#endif
-------------------------
否则会造成如下编译错误,
arm-linux-gcc -I../libswscale -I../libavcodec  -DHAVE_AV_CONFIG_H -D_FILE_OFFSET                                              _BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE -I.. -I.. -I../libavutil -Wdisable                                              d-optimization -Wno-pointer-sign -Wdeclaration-after-statement -I. -I.. -I../lib                                              avutil -Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4   -pipe -ffast-ma                                              th -fomit-frame-pointer -D_REENTRANT -DHAVE_CONFIG_H -I/home/workspace/MPlayer/M                                              Player-1.0rc2/../output/linux_arm/include -I/usr/X11R6/include  -c -o armv4l/dsp                                              util_arm_s.o armv4l/dsputil_arm_s.S
cc1: warning: include location "/usr/X11R6/include" is unsafe for cross-compilat                                              ion
armv4l/dsputil_arm_s.S: Assembler messages:
armv4l/dsputil_arm_s.S:79: Error: selected processor does not support `pld [r1]''
armv4l/dsputil_arm_s.S:90: Error: selected processor does not support `pld [r1]''
armv4l/dsputil_arm_s.S:100: Error: selected processor does not support `pld [r1]                                              ''
armv4l/dsputil_arm_s.S:111: Error: selected processor does not support `pld [r1]                                              ''
armv4l/dsputil_arm_s.S:122: Error: selected processor does not support `pld [r1]                                              ''
armv4l/dsputil_arm_s.S:141: Error: selected processor does not support `pld [r1] 

错误原因是pld指令只在armv5te以上版本有效,在2440(armv4l)无效

 预读取PLD指令
功能:cache预读取(PLD,PreLoad),使用PLD指示存储系统从后面几条指令所指定的存储器地址读取,存储系统可使用这种方法加速以后的存储器访问。

格式:
PLD[Rn,{offset}]
其中:
Rn         存储器的基址寄存器。
Offset     加在Rn上的偏移量。含义同3。2。3节第1条指令