Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
69e7336b
Commit
69e7336b
authored
Jul 29, 2014
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avstring: Expose the simple name match function
Signed-off-by:
Vittorio Giovara
<
vittorio.giovara@gmail.com
>
parent
e253a9e2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
20 deletions
+34
-20
APIchanges
doc/APIchanges
+3
-0
format.c
libavformat/format.c
+1
-19
avstring.c
libavutil/avstring.c
+20
-0
avstring.h
libavutil/avstring.h
+9
-0
version.h
libavutil/version.h
+1
-1
No files found.
doc/APIchanges
View file @
69e7336b
...
...
@@ -13,6 +13,9 @@ libavutil: 2013-12-xx
API changes, most recent first:
2014-07-xx - xxxxxxx - lavu 53.19.0 - avstring.h
Make name matching function from lavf public as av_match_name().
2014-xx-xx - xxxxxxx - lavc 55.57.0 - avcodec.h
Add AV_CODEC_PROP_REORDER to mark codecs supporting frame reordering.
...
...
libavformat/format.c
View file @
69e7336b
...
...
@@ -100,24 +100,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
)
{
...
...
@@ -180,7 +162,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
;
}
...
...
libavutil/avstring.c
View file @
69e7336b
...
...
@@ -234,6 +234,26 @@ 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
);
}
#ifdef TEST
int
main
(
void
)
...
...
libavutil/avstring.h
View file @
69e7336b
...
...
@@ -219,6 +219,15 @@ const char *av_basename(const char *path);
*/
const
char
*
av_dirname
(
char
*
path
);
/**
* Match instances of a name in a comma-separated list of names.
* @param name Name to look for.
* @param names List of names.
* @return 1 on match, 0 otherwise.
*/
int
av_match_name
(
const
char
*
name
,
const
char
*
names
);
/**
* @}
*/
...
...
libavutil/version.h
View file @
69e7336b
...
...
@@ -54,7 +54,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 53
#define LIBAVUTIL_VERSION_MINOR 1
8
#define LIBAVUTIL_VERSION_MINOR 1
9
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment