After downloading the FFMPEG source code in July, compile it in mingw. FFmpeg warned that the GCC version is too old, resulting in non-alignment of stacks and possible problems. We recommend that you use gcc4.2 or later. So we downloaded the latest stable version gcc4.5.0 for compilation. However, a compilation error occurs: The strcasecmp statement is inaccurate.
Define in the header file (libavutil/avstring. h) # define strcasecmp stricmp
The problem persists.
So I implemented two functions myself.
Static inline char _ hack_charget (char C)
{
If (C> = 'A' & C <= 'Z ')
C + = 'a'-'A ';
Return C;
}
Static inline int hack_strcasecmp (char const * a, char const * B)
{
Char AC, BC;
Int R;
For (;;){
AC = _ hack_charget (* A ++ );
BC = _ hack_charget (* B ++ );
R = (INT) Ac-(INT) BC;
If (r)
Return R;
If (! AC)
Return 0;
}
}
Static inline int hack_strncasecmp (char const * a, char const * B, int N)
{
Char AC, BC;
Int R, I;
For (I = 0; I <n; ++ I ){
AC = _ hack_charget (* A ++ );
BC = _ hack_charget (* B ++ );
R = (INT) Ac-(INT) BC;
If (r)
Return R;
If (! AC)
Return 0;
}
Return 0;
}
# Define strcasecmp hack_strcasecmp
# Define strncasecmp hack_strncasecmp
Include this file in avstring. h and metadata. h. The problem is solved. The test results are correct.
I Google this question. Some foreigners are stuck here and are asking around.
Summary:
Even the published GCC and FFMPEG have such low-level problems. After all, the source code is available and you can solve the problem.