Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
784ea81e
Commit
784ea81e
authored
Aug 21, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: adaptative: fix appending absolute path
parent
35162044
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
modules/demux/adaptative/playlist/Url.cpp
modules/demux/adaptative/playlist/Url.cpp
+21
-3
modules/demux/adaptative/playlist/Url.hpp
modules/demux/adaptative/playlist/Url.hpp
+1
-0
No files found.
modules/demux/adaptative/playlist/Url.cpp
View file @
784ea81e
...
@@ -72,6 +72,24 @@ Url & Url::prepend(const Url &url)
...
@@ -72,6 +72,24 @@ Url & Url::prepend(const Url &url)
Url
&
Url
::
append
(
const
Url
&
url
)
Url
&
Url
::
append
(
const
Url
&
url
)
{
{
if
(
!
components
.
empty
()
&&
url
.
components
.
front
().
b_absolute
)
{
if
(
components
.
front
().
b_scheme
)
{
while
(
components
.
size
()
>
1
)
components
.
pop_back
();
std
::
string
scheme
(
components
.
front
().
component
);
std
::
size_t
schemepos
=
scheme
.
find_first_of
(
"://"
);
if
(
schemepos
!=
std
::
string
::
npos
)
{
std
::
size_t
pathpos
=
scheme
.
find_first_of
(
'/'
,
schemepos
+
3
);
if
(
pathpos
!=
std
::
string
::
npos
)
components
.
front
().
component
=
scheme
.
substr
(
0
,
pathpos
);
/* otherwise should be domain only */
}
}
}
if
(
!
components
.
empty
()
&&
!
components
.
back
().
b_dir
)
if
(
!
components
.
empty
()
&&
!
components
.
back
().
b_dir
)
components
.
pop_back
();
components
.
pop_back
();
components
.
insert
(
components
.
end
(),
url
.
components
.
begin
(),
url
.
components
.
end
());
components
.
insert
(
components
.
end
(),
url
.
components
.
begin
(),
url
.
components
.
end
());
...
@@ -99,12 +117,12 @@ std::string Url::toString(size_t index, const BaseRepresentation *rep) const
...
@@ -99,12 +117,12 @@ std::string Url::toString(size_t index, const BaseRepresentation *rep) const
}
}
Url
::
Component
::
Component
(
const
std
::
string
&
str
,
const
MediaSegmentTemplate
*
templ_
)
Url
::
Component
::
Component
(
const
std
::
string
&
str
,
const
MediaSegmentTemplate
*
templ_
)
:
component
(
str
),
templ
(
templ_
),
b_scheme
(
false
),
b_dir
(
false
)
:
component
(
str
),
templ
(
templ_
),
b_scheme
(
false
),
b_dir
(
false
)
,
b_absolute
(
false
)
{
{
if
(
!
component
.
empty
())
if
(
!
component
.
empty
())
{
{
b_dir
=
(
component
[
component
.
length
()
-
1
]
==
'/'
);
b_dir
=
(
component
[
component
.
length
()
-
1
]
==
'/'
);
b_scheme
=
!
component
.
compare
(
0
,
7
,
"http://"
)
||
!
component
.
compare
(
0
,
8
,
"https://"
);
b_scheme
=
(
component
.
find_first_of
(
"://"
)
==
(
component
.
find_first_of
(
'/'
)
-
1
));
b_absolute
=
(
component
[
0
]
==
'/'
);
}
}
}
}
modules/demux/adaptative/playlist/Url.hpp
View file @
784ea81e
...
@@ -51,6 +51,7 @@ namespace adaptative
...
@@ -51,6 +51,7 @@ namespace adaptative
private:
private:
bool
b_scheme
;
bool
b_scheme
;
bool
b_dir
;
bool
b_dir
;
bool
b_absolute
;
};
};
Url
();
Url
();
...
...
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