aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/format.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-07-29 20:09:15 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-07-29 20:24:42 +0200
commit31e0b5d3cb40acd960b6f6c711557a82dc2d6c5f (patch)
treec2854dbdc4da5a38bf9b791e7288ae9b3d7688c9 /libavformat/format.c
parente066f01539fd2ed19bda2031c43ddf266f0a000a (diff)
parent69e7336b8e16ee65226fc20381baf537f4b125e6 (diff)
downloadffmpeg-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 'libavformat/format.c')
-rw-r--r--libavformat/format.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/libavformat/format.c b/libavformat/format.c
index e2eeb6ff09..4b3d55a2e3 100644
--- a/libavformat/format.c
+++ b/libavformat/format.c
@@ -104,24 +104,6 @@ int av_match_ext(const char *filename, const char *extensions)
return 0;
}
-static int match_format(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);
-}
-
AVOutputFormat *av_guess_format(const char *short_name, const char *filename,
const char *mime_type)
{
@@ -141,7 +123,7 @@ AVOutputFormat *av_guess_format(const char *short_name, const char *filename,
score_max = 0;
while ((fmt = av_oformat_next(fmt))) {
score = 0;
- if (fmt->name && short_name && match_format(short_name, fmt->name))
+ if (fmt->name && short_name && av_match_name(short_name, fmt->name))
score += 100;
if (fmt->mime_type && mime_type && !strcmp(fmt->mime_type, mime_type))
score += 10;
@@ -188,7 +170,7 @@ AVInputFormat *av_find_input_format(const char *short_name)
{
AVInputFormat *fmt = NULL;
while ((fmt = av_iformat_next(fmt)))
- if (match_format(short_name, fmt->name))
+ if (av_match_name(short_name, fmt->name))
return fmt;
return NULL;
}