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
9d7819b9
Commit
9d7819b9
authored
Feb 10, 2016
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: hls: fix integer reading
parent
565dd315
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
19 additions
and
0 deletions
+19
-0
modules/demux/adaptative/http/HTTPConnection.cpp
modules/demux/adaptative/http/HTTPConnection.cpp
+3
-0
modules/demux/adaptative/playlist/ID.cpp
modules/demux/adaptative/playlist/ID.cpp
+1
-0
modules/demux/adaptative/playlist/Segment.cpp
modules/demux/adaptative/playlist/Segment.cpp
+1
-0
modules/demux/adaptative/playlist/SegmentTimeline.cpp
modules/demux/adaptative/playlist/SegmentTimeline.cpp
+1
-0
modules/demux/adaptative/tools/Conversions.cpp
modules/demux/adaptative/tools/Conversions.cpp
+1
-0
modules/demux/adaptative/tools/Conversions.hpp
modules/demux/adaptative/tools/Conversions.hpp
+1
-0
modules/demux/dash/mpd/Representation.cpp
modules/demux/dash/mpd/Representation.cpp
+5
-0
modules/demux/hls/playlist/HLSSegment.cpp
modules/demux/hls/playlist/HLSSegment.cpp
+1
-0
modules/demux/hls/playlist/Tags.cpp
modules/demux/hls/playlist/Tags.cpp
+3
-0
modules/demux/smooth/playlist/Representation.cpp
modules/demux/smooth/playlist/Representation.cpp
+2
-0
No files found.
modules/demux/adaptative/http/HTTPConnection.cpp
View file @
9d7819b9
...
@@ -179,6 +179,7 @@ int HTTPConnection::parseReply()
...
@@ -179,6 +179,7 @@ int HTTPConnection::parseReply()
return
VLC_ENOOBJ
;
return
VLC_ENOOBJ
;
std
::
istringstream
ss
(
line
.
substr
(
9
));
std
::
istringstream
ss
(
line
.
substr
(
9
));
ss
.
imbue
(
std
::
locale
(
"C"
));
int
replycode
;
int
replycode
;
ss
>>
replycode
;
ss
>>
replycode
;
if
(
replycode
!=
200
&&
replycode
!=
206
)
if
(
replycode
!=
200
&&
replycode
!=
206
)
...
@@ -239,6 +240,7 @@ void HTTPConnection::onHeader(const std::string &key,
...
@@ -239,6 +240,7 @@ void HTTPConnection::onHeader(const std::string &key,
if
(
key
==
"Content-Length"
)
if
(
key
==
"Content-Length"
)
{
{
std
::
istringstream
ss
(
value
);
std
::
istringstream
ss
(
value
);
ss
.
imbue
(
std
::
locale
(
"C"
));
size_t
length
;
size_t
length
;
ss
>>
length
;
ss
>>
length
;
contentLength
=
length
;
contentLength
=
length
;
...
@@ -264,6 +266,7 @@ std::string HTTPConnection::buildRequestHeader(const std::string &path) const
...
@@ -264,6 +266,7 @@ std::string HTTPConnection::buildRequestHeader(const std::string &path) const
std
::
string
HTTPConnection
::
extraRequestHeaders
()
const
std
::
string
HTTPConnection
::
extraRequestHeaders
()
const
{
{
std
::
stringstream
ss
;
std
::
stringstream
ss
;
ss
.
imbue
(
std
::
locale
(
"C"
));
if
(
bytesRange
.
isValid
())
if
(
bytesRange
.
isValid
())
{
{
ss
<<
"Range: bytes="
<<
bytesRange
.
getStartByte
()
<<
"-"
;
ss
<<
"Range: bytes="
<<
bytesRange
.
getStartByte
()
<<
"-"
;
...
...
modules/demux/adaptative/playlist/ID.cpp
View file @
9d7819b9
...
@@ -30,6 +30,7 @@ ID::ID(const std::string &id_)
...
@@ -30,6 +30,7 @@ ID::ID(const std::string &id_)
ID
::
ID
(
uint64_t
id_
)
ID
::
ID
(
uint64_t
id_
)
{
{
std
::
stringstream
ss
;
std
::
stringstream
ss
;
ss
.
imbue
(
std
::
locale
(
"C"
));
ss
<<
"default_id#"
<<
id_
;
ss
<<
"default_id#"
<<
id_
;
id
=
ss
.
str
();
id
=
ss
.
str
();
}
}
...
...
modules/demux/adaptative/playlist/Segment.cpp
View file @
9d7819b9
...
@@ -123,6 +123,7 @@ size_t ISegment::getOffset() const
...
@@ -123,6 +123,7 @@ size_t ISegment::getOffset() const
void
ISegment
::
debug
(
vlc_object_t
*
obj
,
int
indent
)
const
void
ISegment
::
debug
(
vlc_object_t
*
obj
,
int
indent
)
const
{
{
std
::
stringstream
ss
;
std
::
stringstream
ss
;
ss
.
imbue
(
std
::
locale
(
"C"
));
ss
<<
std
::
string
(
indent
,
' '
)
<<
debugName
<<
" #"
<<
getSequenceNumber
();
ss
<<
std
::
string
(
indent
,
' '
)
<<
debugName
<<
" #"
<<
getSequenceNumber
();
ss
<<
" url="
<<
getUrlSegment
().
toString
();
ss
<<
" url="
<<
getUrlSegment
().
toString
();
if
(
startByte
!=
endByte
)
if
(
startByte
!=
endByte
)
...
...
modules/demux/adaptative/playlist/SegmentTimeline.cpp
View file @
9d7819b9
...
@@ -274,6 +274,7 @@ bool SegmentTimeline::Element::contains(stime_t time) const
...
@@ -274,6 +274,7 @@ bool SegmentTimeline::Element::contains(stime_t time) const
void
SegmentTimeline
::
Element
::
debug
(
vlc_object_t
*
obj
,
int
indent
)
const
void
SegmentTimeline
::
Element
::
debug
(
vlc_object_t
*
obj
,
int
indent
)
const
{
{
std
::
stringstream
ss
;
std
::
stringstream
ss
;
ss
.
imbue
(
std
::
locale
(
"C"
));
ss
<<
std
::
string
(
indent
+
1
,
' '
)
<<
"Element #"
<<
number
ss
<<
std
::
string
(
indent
+
1
,
' '
)
<<
"Element #"
<<
number
<<
" d="
<<
d
<<
" r="
<<
r
<<
" @t="
<<
t
;
<<
" d="
<<
d
<<
" r="
<<
r
<<
" @t="
<<
t
;
msg_Dbg
(
obj
,
"%s"
,
ss
.
str
().
c_str
());
msg_Dbg
(
obj
,
"%s"
,
ss
.
str
().
c_str
());
...
...
modules/demux/adaptative/tools/Conversions.cpp
View file @
9d7819b9
...
@@ -96,6 +96,7 @@ UTCTime::UTCTime(const std::string &str)
...
@@ -96,6 +96,7 @@ UTCTime::UTCTime(const std::string &str)
enum
{
UTCTIME_YEAR
=
0
,
UTCTIME_MON
,
UTCTIME_DAY
,
UTCTIME_HOUR
,
UTCTIME_MIN
,
UTCTIME_SEC
,
UTCTIME_MSEC
,
UTCTIME_TZ
};
enum
{
UTCTIME_YEAR
=
0
,
UTCTIME_MON
,
UTCTIME_DAY
,
UTCTIME_HOUR
,
UTCTIME_MIN
,
UTCTIME_SEC
,
UTCTIME_MSEC
,
UTCTIME_TZ
};
int
values
[
8
]
=
{
0
};
int
values
[
8
]
=
{
0
};
std
::
istringstream
in
(
str
);
std
::
istringstream
in
(
str
);
in
.
imbue
(
std
::
locale
(
"C"
));
try
try
{
{
...
...
modules/demux/adaptative/tools/Conversions.hpp
View file @
9d7819b9
...
@@ -57,6 +57,7 @@ template<typename T> class Integer
...
@@ -57,6 +57,7 @@ template<typename T> class Integer
try
try
{
{
std
::
istringstream
in
(
str
);
std
::
istringstream
in
(
str
);
in
.
imbue
(
std
::
locale
(
"C"
));
in
>>
value
;
in
>>
value
;
}
catch
(
int
)
{
}
catch
(
int
)
{
value
=
0
;
value
=
0
;
...
...
modules/demux/dash/mpd/Representation.cpp
View file @
9d7819b9
...
@@ -102,6 +102,7 @@ std::string Representation::contextualize(size_t number, const std::string &comp
...
@@ -102,6 +102,7 @@ std::string Representation::contextualize(size_t number, const std::string &comp
if
(
pos
!=
std
::
string
::
npos
)
if
(
pos
!=
std
::
string
::
npos
)
{
{
std
::
stringstream
ss
;
std
::
stringstream
ss
;
ss
.
imbue
(
std
::
locale
(
"C"
));
ss
<<
getScaledTimeBySegmentNumber
(
number
,
templ
);
ss
<<
getScaledTimeBySegmentNumber
(
number
,
templ
);
ret
.
replace
(
pos
,
std
::
string
(
"$Time$"
).
length
(),
ss
.
str
());
ret
.
replace
(
pos
,
std
::
string
(
"$Time$"
).
length
(),
ss
.
str
());
}
}
...
@@ -110,6 +111,7 @@ std::string Representation::contextualize(size_t number, const std::string &comp
...
@@ -110,6 +111,7 @@ std::string Representation::contextualize(size_t number, const std::string &comp
if
(
pos
!=
std
::
string
::
npos
)
if
(
pos
!=
std
::
string
::
npos
)
{
{
std
::
stringstream
ss
;
std
::
stringstream
ss
;
ss
.
imbue
(
std
::
locale
(
"C"
));
ss
<<
getLiveTemplateNumberOffset
(
number
,
templ
);
ss
<<
getLiveTemplateNumberOffset
(
number
,
templ
);
ret
.
replace
(
pos
,
std
::
string
(
"$Number$"
).
length
(),
ss
.
str
());
ret
.
replace
(
pos
,
std
::
string
(
"$Number$"
).
length
(),
ss
.
str
());
}
}
...
@@ -124,6 +126,7 @@ std::string Representation::contextualize(size_t number, const std::string &comp
...
@@ -124,6 +126,7 @@ std::string Representation::contextualize(size_t number, const std::string &comp
if
(
fmtend
!=
std
::
string
::
npos
)
if
(
fmtend
!=
std
::
string
::
npos
)
{
{
std
::
istringstream
iss
(
ret
.
substr
(
fmtstart
,
fmtend
-
fmtstart
+
1
));
std
::
istringstream
iss
(
ret
.
substr
(
fmtstart
,
fmtend
-
fmtstart
+
1
));
iss
.
imbue
(
std
::
locale
(
"C"
));
try
try
{
{
size_t
width
;
size_t
width
;
...
@@ -131,6 +134,7 @@ std::string Representation::contextualize(size_t number, const std::string &comp
...
@@ -131,6 +134,7 @@ std::string Representation::contextualize(size_t number, const std::string &comp
if
(
iss
.
peek
()
!=
'$'
&&
iss
.
peek
()
!=
'd'
)
if
(
iss
.
peek
()
!=
'$'
&&
iss
.
peek
()
!=
'd'
)
throw
VLC_EGENERIC
;
throw
VLC_EGENERIC
;
std
::
stringstream
oss
;
std
::
stringstream
oss
;
oss
.
imbue
(
std
::
locale
(
"C"
));
oss
.
width
(
width
);
/* set format string length */
oss
.
width
(
width
);
/* set format string length */
oss
.
fill
(
'0'
);
oss
.
fill
(
'0'
);
oss
<<
getLiveTemplateNumberOffset
(
number
,
templ
);
oss
<<
getLiveTemplateNumberOffset
(
number
,
templ
);
...
@@ -145,6 +149,7 @@ std::string Representation::contextualize(size_t number, const std::string &comp
...
@@ -145,6 +149,7 @@ std::string Representation::contextualize(size_t number, const std::string &comp
if
(
pos
!=
std
::
string
::
npos
)
if
(
pos
!=
std
::
string
::
npos
)
{
{
std
::
stringstream
ss
;
std
::
stringstream
ss
;
ss
.
imbue
(
std
::
locale
(
"C"
));
ss
<<
getBandwidth
();
ss
<<
getBandwidth
();
ret
.
replace
(
pos
,
std
::
string
(
"$Bandwidth$"
).
length
(),
ss
.
str
());
ret
.
replace
(
pos
,
std
::
string
(
"$Bandwidth$"
).
length
(),
ss
.
str
());
}
}
...
...
modules/demux/hls/playlist/HLSSegment.cpp
View file @
9d7819b9
...
@@ -136,6 +136,7 @@ void HLSSegment::setEncryption(SegmentEncryption &enc)
...
@@ -136,6 +136,7 @@ void HLSSegment::setEncryption(SegmentEncryption &enc)
void
HLSSegment
::
debug
(
vlc_object_t
*
obj
,
int
indent
)
const
void
HLSSegment
::
debug
(
vlc_object_t
*
obj
,
int
indent
)
const
{
{
std
::
stringstream
ss
;
std
::
stringstream
ss
;
ss
.
imbue
(
std
::
locale
(
"C"
));
ss
<<
std
::
string
(
indent
,
' '
)
<<
debugName
<<
ss
<<
std
::
string
(
indent
,
' '
)
<<
debugName
<<
" #"
<<
(
getSequenceNumber
()
-
Segment
::
SEQUENCE_FIRST
)
<<
" #"
<<
(
getSequenceNumber
()
-
Segment
::
SEQUENCE_FIRST
)
<<
" url="
<<
getUrlSegment
().
toString
();
" url="
<<
getUrlSegment
().
toString
();
...
...
modules/demux/hls/playlist/Tags.cpp
View file @
9d7819b9
...
@@ -37,6 +37,7 @@ Attribute::Attribute(const std::string &name_, const std::string &value_)
...
@@ -37,6 +37,7 @@ Attribute::Attribute(const std::string &name_, const std::string &value_)
uint64_t
Attribute
::
decimal
()
const
uint64_t
Attribute
::
decimal
()
const
{
{
std
::
istringstream
is
(
value
);
std
::
istringstream
is
(
value
);
is
.
imbue
(
std
::
locale
(
"C"
));
uint64_t
ret
;
uint64_t
ret
;
is
>>
ret
;
is
>>
ret
;
return
ret
;
return
ret
;
...
@@ -72,6 +73,7 @@ std::pair<std::size_t,std::size_t> Attribute::getByteRange() const
...
@@ -72,6 +73,7 @@ std::pair<std::size_t,std::size_t> Attribute::getByteRange() const
std
::
size_t
length
=
0
;
std
::
size_t
length
=
0
;
std
::
size_t
offset
=
0
;
std
::
size_t
offset
=
0
;
std
::
istringstream
is
(
value
);
std
::
istringstream
is
(
value
);
is
.
imbue
(
std
::
locale
(
"C"
));
if
(
!
is
.
eof
())
if
(
!
is
.
eof
())
{
{
...
@@ -92,6 +94,7 @@ std::pair<int, int> Attribute::getResolution() const
...
@@ -92,6 +94,7 @@ std::pair<int, int> Attribute::getResolution() const
int
w
=
0
,
h
=
0
;
int
w
=
0
,
h
=
0
;
std
::
istringstream
is
(
value
);
std
::
istringstream
is
(
value
);
is
.
imbue
(
std
::
locale
(
"C"
));
if
(
!
is
.
eof
())
if
(
!
is
.
eof
())
{
{
is
>>
w
;
is
>>
w
;
...
...
modules/demux/smooth/playlist/Representation.cpp
View file @
9d7819b9
...
@@ -56,6 +56,7 @@ std::string Representation::contextualize(size_t number, const std::string &comp
...
@@ -56,6 +56,7 @@ std::string Representation::contextualize(size_t number, const std::string &comp
if
(
pos
!=
std
::
string
::
npos
)
if
(
pos
!=
std
::
string
::
npos
)
{
{
std
::
stringstream
ss
;
std
::
stringstream
ss
;
ss
.
imbue
(
std
::
locale
(
"C"
));
ss
<<
templ
->
segmentTimeline
.
Get
()
->
getScaledPlaybackTimeByElementNumber
(
number
);
ss
<<
templ
->
segmentTimeline
.
Get
()
->
getScaledPlaybackTimeByElementNumber
(
number
);
ret
.
replace
(
pos
,
std
::
string
(
"{start_time}"
).
length
(),
ss
.
str
());
ret
.
replace
(
pos
,
std
::
string
(
"{start_time}"
).
length
(),
ss
.
str
());
}
}
...
@@ -67,6 +68,7 @@ std::string Representation::contextualize(size_t number, const std::string &comp
...
@@ -67,6 +68,7 @@ std::string Representation::contextualize(size_t number, const std::string &comp
if
(
pos
!=
std
::
string
::
npos
)
if
(
pos
!=
std
::
string
::
npos
)
{
{
std
::
stringstream
ss
;
std
::
stringstream
ss
;
ss
.
imbue
(
std
::
locale
(
"C"
));
ss
<<
getBandwidth
();
ss
<<
getBandwidth
();
ret
.
replace
(
pos
,
std
::
string
(
"{bitrate}"
).
length
(),
ss
.
str
());
ret
.
replace
(
pos
,
std
::
string
(
"{bitrate}"
).
length
(),
ss
.
str
());
}
}
...
...
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