diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-07-29 20:09:15 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-29 20:24:42 +0200 |
commit | 31e0b5d3cb40acd960b6f6c711557a82dc2d6c5f (patch) | |
tree | c2854dbdc4da5a38bf9b791e7288ae9b3d7688c9 /libavutil/avstring.c | |
parent | e066f01539fd2ed19bda2031c43ddf266f0a000a (diff) | |
parent | 69e7336b8e16ee65226fc20381baf537f4b125e6 (diff) | |
download | ffmpeg-31e0b5d3cb40acd960b6f6c711557a82dc2d6c5f.tar.gz |
Merge commit '69e7336b8e16ee65226fc20381baf537f4b125e6'
* commit '69e7336b8e16ee65226fc20381baf537f4b125e6':
avstring: Expose the simple name match function
Conflicts:
libavutil/avstring.c
libavutil/avstring.h
libavutil/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/avstring.c')
-rw-r--r-- | libavutil/avstring.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libavutil/avstring.c b/libavutil/avstring.c index e75cdc6312..a63fb84bcf 100644 --- a/libavutil/avstring.c +++ b/libavutil/avstring.c @@ -307,6 +307,24 @@ int av_isxdigit(int c) return av_isdigit(c) || (c >= 'a' && c <= 'f'); } +int av_match_name(const char *name, const char *names) +{ + const char *p; + int len, namelen; + + if (!name || !names) + return 0; + + namelen = strlen(name); + while ((p = strchr(names, ','))) { + len = FFMAX(p - names, namelen); + if (!av_strncasecmp(name, names, len)) + return 1; + names = p + 1; + } + return !av_strcasecmp(name, names); +} + int av_utf8_decode(int32_t *codep, const uint8_t **bufp, const uint8_t *buf_end, unsigned int flags) { |