Revision 742d87d6 libavcodec/opts.c

View differences:

libavcodec/opts.c
11 11
 */
12 12

  
13 13
#include "avcodec.h"
14
#include "os_support.h"
15 14

  
16 15
const AVOption avoptions_common[] = {
17 16
    AVOPTION_CODEC_FLAG("bit_exact", "use only bit-exact stuff", flags, CODEC_FLAG_BITEXACT, 0),
......
40 39
    AVOPTION_END()
41 40
};
42 41

  
42
/* avoid compatibility problems by redefining it */
43
static int av_strcasecmp(const char *s1, const char *s2)
44
{
45
    signed char val;
46
    
47
    for(;;) {
48
        val = toupper(*s1) - toupper(*s2);
49
        if (val != 0)
50
            break;
51
        if (*s1 != '\0')
52
            break;
53
        s1++;
54
        s2++;
55
    }
56
    return val;
57
}
58

  
43 59

  
44 60
static int parse_bool(const AVOption *c, char *s, int *var)
45 61
{
46 62
    int b = 1; /* by default -on- when present */
47 63
    if (s) {
48
	if (!strcasecmp(s, "off") || !strcasecmp(s, "false")
64
	if (!av_strcasecmp(s, "off") || !av_strcasecmp(s, "false")
49 65
	    || !strcmp(s, "0"))
50 66
	    b = 0;
51
	else if (!strcasecmp(s, "on") || !strcasecmp(s, "true")
67
	else if (!av_strcasecmp(s, "on") || !av_strcasecmp(s, "true")
52 68
		 || !strcmp(s, "1"))
53 69
	    b = 1;
54 70
	else

Also available in: Unified diff