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
0d92b0d5
Commit
0d92b0d5
authored
Sep 30, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil/avstring: Factor av_match_list() out
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
6ea357ea
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
19 deletions
+36
-19
APIchanges
doc/APIchanges
+3
-0
format.c
libavformat/format.c
+3
-17
avstring.c
libavutil/avstring.c
+21
-0
avstring.h
libavutil/avstring.h
+7
-0
version.h
libavutil/version.h
+2
-2
No files found.
doc/APIchanges
View file @
0d92b0d5
...
@@ -15,6 +15,9 @@ libavutil: 2014-08-09
...
@@ -15,6 +15,9 @@ libavutil: 2014-08-09
API changes, most recent first:
API changes, most recent first:
2014-10-02 - xxxxxxx - lavu 54.8.100 - avstring.h
Add av_match_list()
2014-09-24 - xxxxxxx - libpostproc 53.1.100
2014-09-24 - xxxxxxx - libpostproc 53.1.100
Add visualization support
Add visualization support
...
...
libavformat/format.c
View file @
0d92b0d5
...
@@ -80,28 +80,14 @@ void av_register_output_format(AVOutputFormat *format)
...
@@ -80,28 +80,14 @@ void av_register_output_format(AVOutputFormat *format)
int
av_match_ext
(
const
char
*
filename
,
const
char
*
extensions
)
int
av_match_ext
(
const
char
*
filename
,
const
char
*
extensions
)
{
{
const
char
*
ext
,
*
p
;
const
char
*
ext
;
char
ext1
[
32
],
*
q
;
if
(
!
filename
)
if
(
!
filename
)
return
0
;
return
0
;
ext
=
strrchr
(
filename
,
'.'
);
ext
=
strrchr
(
filename
,
'.'
);
if
(
ext
)
{
if
(
ext
)
ext
++
;
return
av_match_list
(
ext
+
1
,
extensions
,
','
);
p
=
extensions
;
for
(;;)
{
q
=
ext1
;
while
(
*
p
!=
'\0'
&&
*
p
!=
','
&&
q
-
ext1
<
sizeof
(
ext1
)
-
1
)
*
q
++
=
*
p
++
;
*
q
=
'\0'
;
if
(
!
av_strcasecmp
(
ext1
,
ext
))
return
1
;
if
(
*
p
==
'\0'
)
break
;
p
++
;
}
}
return
0
;
return
0
;
}
}
...
...
libavutil/avstring.c
View file @
0d92b0d5
...
@@ -402,6 +402,27 @@ end:
...
@@ -402,6 +402,27 @@ end:
return
ret
;
return
ret
;
}
}
int
av_match_list
(
const
char
*
name
,
const
char
*
list
,
char
separator
)
{
const
char
*
p
;
char
ext1
[
128
],
*
q
;
int
i
;
p
=
list
;
for
(
i
=
1
;;
i
++
)
{
q
=
ext1
;
while
(
*
p
!=
'\0'
&&
*
p
!=
separator
&&
q
-
ext1
<
sizeof
(
ext1
)
-
1
)
*
q
++
=
*
p
++
;
*
q
=
'\0'
;
if
(
!
av_strcasecmp
(
ext1
,
name
))
return
i
;
if
(
*
p
==
'\0'
)
break
;
p
++
;
}
return
0
;
}
#ifdef TEST
#ifdef TEST
int
main
(
void
)
int
main
(
void
)
...
...
libavutil/avstring.h
View file @
0d92b0d5
...
@@ -357,6 +357,13 @@ int av_escape(char **dst, const char *src, const char *special_chars,
...
@@ -357,6 +357,13 @@ int av_escape(char **dst, const char *src, const char *special_chars,
int
av_utf8_decode
(
int32_t
*
codep
,
const
uint8_t
**
bufp
,
const
uint8_t
*
buf_end
,
int
av_utf8_decode
(
int32_t
*
codep
,
const
uint8_t
**
bufp
,
const
uint8_t
*
buf_end
,
unsigned
int
flags
);
unsigned
int
flags
);
/**
* Check if a name is in a list.
* @returns 0 if not found, or the 1 based index where it has been found in the
* list.
*/
int
av_match_list
(
const
char
*
name
,
const
char
*
list
,
char
separator
);
/**
/**
* @}
* @}
*/
*/
...
...
libavutil/version.h
View file @
0d92b0d5
...
@@ -56,8 +56,8 @@
...
@@ -56,8 +56,8 @@
*/
*/
#define LIBAVUTIL_VERSION_MAJOR 54
#define LIBAVUTIL_VERSION_MAJOR 54
#define LIBAVUTIL_VERSION_MINOR
7
#define LIBAVUTIL_VERSION_MINOR
8
#define LIBAVUTIL_VERSION_MICRO 10
1
#define LIBAVUTIL_VERSION_MICRO 10
0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \
LIBAVUTIL_VERSION_MINOR, \
...
...
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