以下问题都是由于使用SDL2-2.0.3的缘故,如果使用SDL-1.2.15的话,则没有这些问题。
MINGW32:/c/ffmpeg/ffmpeg-2.6.3
configure后,显示出SDL support no,C:\ffmpeg\ffmpeg-2.6.3中生成的config.mak用UltraEdit打开,看到!CONFIG_FFPLAY=yes,!HAVE_SDL=yes,感叹号代表注释掉了,要手动修改config.mak,把感叹号去掉。
另外,我用的SDL2-2.0.3,C:\ffmpeg\ffmpeg-2.6.3中的configure文件用UltraEdit打开,5028行处,把sdl-config改为sdl2-config。否则的话,在make时,会出现如下错误:
ffplay.c:57:17: fatal error: SDL.h: No such file or directory
#include <SDL.h>
^
compilation terminated.
make: *** [ffplay.o] Error 1
还有一个问题:
In file included from c:/mingw/include/SDL2/SDL_config.h:25:0,
from c:/mingw/include/SDL2/SDL_stdinc.h:31,
from c:/mingw/include/SDL2/SDL_main.h:25,
from c:/mingw/include/SDL2/SDL.h:67,
from ffplay.c:57:
c:/mingw/include/SDL2/SDL_platform.h:121:26: fatal error: winapifamily.h: No such file or directory
#include <winapifamily.h>
^
compilation terminated.
make: *** [ffplay.o] Error 1
解决:
This is a bug in SDL 2.0.3. A fix has been committed for SDL's next release. In the meantime, here's a link to the fixed copy of SDL_platform.h:
https://hg.libsdl.org/SDL/raw-file/e217ed463f25/include/SDL_platform.h
If you drop the file into SDL 2.0.3's include\SDL2\ directory, overwriting the original, your app(s) should compile ok.
另外,SDL 1.2到SDL 2.0,API有很大改动,所以要更改ffplay.c中的相关代码。