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
a9a721da
Commit
a9a721da
authored
Jul 24, 2002
by
Fabrice Bellard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added url_split()
Originally committed as revision 800 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
bdd7d518
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
utils.c
libav/utils.c
+51
-0
No files found.
libav/utils.c
View file @
a9a721da
...
...
@@ -1092,3 +1092,54 @@ void av_hex_dump(UINT8 *buf, int size)
}
}
void
url_split
(
char
*
proto
,
int
proto_size
,
char
*
hostname
,
int
hostname_size
,
int
*
port_ptr
,
char
*
path
,
int
path_size
,
const
char
*
url
)
{
const
char
*
p
;
char
*
q
;
int
port
;
port
=
-
1
;
p
=
url
;
q
=
proto
;
while
(
*
p
!=
':'
&&
*
p
!=
'\0'
)
{
if
((
q
-
proto
)
<
proto_size
-
1
)
*
q
++
=
*
p
;
p
++
;
}
if
(
proto_size
>
0
)
*
q
=
'\0'
;
if
(
*
p
==
'\0'
)
{
if
(
proto_size
>
0
)
proto
[
0
]
=
'\0'
;
if
(
hostname_size
>
0
)
hostname
[
0
]
=
'\0'
;
p
=
url
;
}
else
{
p
++
;
if
(
*
p
==
'/'
)
p
++
;
if
(
*
p
==
'/'
)
p
++
;
q
=
hostname
;
while
(
*
p
!=
':'
&&
*
p
!=
'/'
&&
*
p
!=
'?'
&&
*
p
!=
'\0'
)
{
if
((
q
-
hostname
)
<
hostname_size
-
1
)
*
q
++
=
*
p
;
p
++
;
}
if
(
hostname_size
>
0
)
*
q
=
'\0'
;
if
(
*
p
==
':'
)
{
p
++
;
port
=
strtoul
(
p
,
(
char
**
)
&
p
,
10
);
}
}
if
(
port_ptr
)
*
port_ptr
=
port
;
pstrcpy
(
path
,
path_size
,
p
);
}
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