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
b9606064
Commit
b9606064
authored
Sep 24, 2019
by
Steven Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/hls: support data protocol in uri for EXT-X-MAP
Signed-off-by:
Steven Liu
<
lq@chinaffmpeg.org
>
parent
62a0d226
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
+15
-4
file.c
libavformat/file.c
+2
-2
hls.c
libavformat/hls.c
+12
-1
http.c
libavformat/http.c
+1
-1
No files found.
libavformat/file.c
View file @
b9606064
...
...
@@ -369,7 +369,7 @@ const URLProtocol ff_file_protocol = {
.
url_open_dir
=
file_open_dir
,
.
url_read_dir
=
file_read_dir
,
.
url_close_dir
=
file_close_dir
,
.
default_whitelist
=
"file,crypto"
.
default_whitelist
=
"file,crypto
,data
"
};
#endif
/* CONFIG_FILE_PROTOCOL */
...
...
@@ -408,7 +408,7 @@ const URLProtocol ff_pipe_protocol = {
.
url_check
=
file_check
,
.
priv_data_size
=
sizeof
(
FileContext
),
.
priv_data_class
=
&
pipe_class
,
.
default_whitelist
=
"crypto"
.
default_whitelist
=
"crypto
,data
"
};
#endif
/* CONFIG_PIPE_PROTOCOL */
libavformat/hls.c
View file @
b9606064
...
...
@@ -413,7 +413,11 @@ static struct segment *new_init_section(struct playlist *pls,
if
(
!
sec
)
return
NULL
;
ff_make_absolute_url
(
tmp_str
,
sizeof
(
tmp_str
),
url_base
,
info
->
uri
);
if
(
!
av_strncasecmp
(
info
->
uri
,
"data:"
,
5
))
{
strncpy
(
tmp_str
,
info
->
uri
,
strlen
(
info
->
uri
));
}
else
{
ff_make_absolute_url
(
tmp_str
,
sizeof
(
tmp_str
),
url_base
,
info
->
uri
);
}
sec
->
url
=
av_strdup
(
tmp_str
);
if
(
!
sec
->
url
)
{
av_free
(
sec
);
...
...
@@ -627,6 +631,9 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,
if
(
av_strstart
(
url
,
"crypto"
,
NULL
))
{
if
(
url
[
6
]
==
'+'
||
url
[
6
]
==
':'
)
proto_name
=
avio_find_protocol_name
(
url
+
7
);
}
else
if
(
av_strstart
(
url
,
"data"
,
NULL
))
{
if
(
url
[
4
]
==
'+'
||
url
[
4
]
==
':'
)
proto_name
=
avio_find_protocol_name
(
url
+
5
);
}
if
(
!
proto_name
)
...
...
@@ -646,6 +653,8 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,
}
}
else
if
(
av_strstart
(
proto_name
,
"http"
,
NULL
))
{
is_http
=
1
;
}
else
if
(
av_strstart
(
proto_name
,
"data"
,
NULL
))
{
;
}
else
return
AVERROR_INVALIDDATA
;
...
...
@@ -653,6 +662,8 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,
;
else
if
(
av_strstart
(
url
,
"crypto"
,
NULL
)
&&
!
strncmp
(
proto_name
,
url
+
7
,
strlen
(
proto_name
))
&&
url
[
7
+
strlen
(
proto_name
)]
==
':'
)
;
else
if
(
av_strstart
(
url
,
"data"
,
NULL
)
&&
!
strncmp
(
proto_name
,
url
+
5
,
strlen
(
proto_name
))
&&
url
[
5
+
strlen
(
proto_name
)]
==
':'
)
;
else
if
(
strcmp
(
proto_name
,
"file"
)
||
!
strncmp
(
url
,
"file,"
,
5
))
return
AVERROR_INVALIDDATA
;
...
...
libavformat/http.c
View file @
b9606064
...
...
@@ -1791,7 +1791,7 @@ const URLProtocol ff_http_protocol = {
.
priv_data_size
=
sizeof
(
HTTPContext
),
.
priv_data_class
=
&
http_context_class
,
.
flags
=
URL_PROTOCOL_FLAG_NETWORK
,
.
default_whitelist
=
"http,https,tls,rtp,tcp,udp,crypto,httpproxy"
.
default_whitelist
=
"http,https,tls,rtp,tcp,udp,crypto,httpproxy
,data
"
};
#endif
/* CONFIG_HTTP_PROTOCOL */
...
...
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