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
6161c418
Commit
6161c418
authored
Nov 10, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avio: Support private options in URLProtocols
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
c12e1bd1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
avio.c
libavformat/avio.c
+25
-0
No files found.
libavformat/avio.c
View file @
6161c418
...
...
@@ -145,8 +145,31 @@ static int url_alloc_for_protocol (URLContext **puc, struct URLProtocol *up,
if
(
up
->
priv_data_size
)
{
uc
->
priv_data
=
av_mallocz
(
up
->
priv_data_size
);
if
(
up
->
priv_data_class
)
{
char
*
start
=
strchr
(
uc
->
filename
,
','
);
*
(
const
AVClass
**
)
uc
->
priv_data
=
up
->
priv_data_class
;
av_opt_set_defaults
(
uc
->
priv_data
);
if
(
start
){
int
ret
=
0
;
char
*
p
=
start
;
char
sep
=
*++
p
;
char
*
key
,
*
val
;
p
++
;
while
(
ret
>=
0
&&
(
key
=
strchr
(
p
,
sep
))
&&
p
<
key
&&
(
val
=
strchr
(
key
+
1
,
sep
))){
*
val
=
*
key
=
0
;
ret
=
av_opt_set
(
uc
->
priv_data
,
p
,
key
+
1
,
0
);
if
(
ret
==
AVERROR_OPTION_NOT_FOUND
)
av_log
(
uc
,
AV_LOG_ERROR
,
"Key '%s' not found.
\n
"
,
p
);
*
val
=
*
key
=
sep
;
p
=
val
+
1
;
}
if
(
ret
<
0
||
p
!=
key
){
av_log
(
uc
,
AV_LOG_ERROR
,
"Error parsing options string %s
\n
"
,
start
);
av_freep
(
&
uc
->
priv_data
);
av_freep
(
&
uc
);
goto
fail
;
}
memmove
(
start
,
key
+
1
,
strlen
(
key
));
}
}
}
if
(
int_cb
)
...
...
@@ -277,6 +300,8 @@ int ffurl_alloc(URLContext **puc, const char *filename, int flags,
else
av_strlcpy
(
proto_str
,
filename
,
FFMIN
(
proto_end
-
filename
+
1
,
sizeof
(
proto_str
)));
if
((
ptr
=
strchr
(
proto_str
,
','
)))
*
ptr
=
'\0'
;
av_strlcpy
(
proto_nested
,
proto_str
,
sizeof
(
proto_nested
));
if
((
ptr
=
strchr
(
proto_nested
,
'+'
)))
*
ptr
=
'\0'
;
...
...
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