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
0fa3d858
Commit
0fa3d858
authored
Nov 23, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: adaptative: fix timezone and add micro seconds
parent
a572661b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
17 deletions
+40
-17
modules/demux/adaptative/tools/Conversions.cpp
modules/demux/adaptative/tools/Conversions.cpp
+36
-14
modules/demux/adaptative/tools/Conversions.hpp
modules/demux/adaptative/tools/Conversions.hpp
+3
-2
modules/demux/dash/mpd/IsoffMainParser.cpp
modules/demux/dash/mpd/IsoffMainParser.cpp
+1
-1
No files found.
modules/demux/adaptative/tools/Conversions.cpp
View file @
0fa3d858
...
@@ -57,8 +57,8 @@ static int64_t vlc_timegm( int i_year, int i_month, int i_mday, int i_hour, int
...
@@ -57,8 +57,8 @@ static int64_t vlc_timegm( int i_year, int i_month, int i_mday, int i_hour, int
UTCTime
::
UTCTime
(
const
std
::
string
&
str
)
UTCTime
::
UTCTime
(
const
std
::
string
&
str
)
{
{
enum
{
YEAR
=
0
,
MON
,
DAY
,
HOUR
,
MIN
,
SEC
,
TZ
};
enum
{
YEAR
=
0
,
MON
,
DAY
,
HOUR
,
MIN
,
SEC
,
MSEC
,
TZ
};
int
values
[
7
]
=
{
0
};
int
values
[
8
]
=
{
0
};
std
::
istringstream
in
(
str
);
std
::
istringstream
in
(
str
);
try
try
...
@@ -79,28 +79,50 @@ UTCTime::UTCTime(const std::string &str)
...
@@ -79,28 +79,50 @@ UTCTime::UTCTime(const std::string &str)
in
>>
values
[
i
];
in
>>
values
[
i
];
}
}
}
}
if
(
!
in
.
eof
()
&&
in
.
peek
()
==
'.'
)
{
in
.
ignore
(
1
);
in
>>
values
[
MSEC
];
}
/* Timezone */
/* Timezone */
if
(
!
in
.
eof
()
&&
in
.
peek
()
==
'Z'
)
if
(
!
in
.
eof
()
&&
in
.
peek
()
==
'Z'
)
{
in
.
ignore
(
1
);
}
else
if
(
!
in
.
eof
()
&&
(
in
.
peek
()
==
'+'
||
in
.
peek
()
==
'-'
))
{
{
int
i
,
tz
=
(
in
.
peek
()
==
'+'
)
?
-
60
:
+
60
;
in
.
ignore
(
1
);
in
.
ignore
(
1
);
while
(
!
in
.
eof
())
if
(
!
in
.
eof
())
{
{
if
(
in
.
peek
()
==
'+'
)
in
>>
i
;
continue
;
tz
*=
i
;
in
>>
values
[
TZ
];
in
.
ignore
(
1
);
break
;
if
(
!
in
.
eof
())
{
in
>>
i
;
tz
+=
i
;
}
values
[
TZ
]
=
tz
;
}
}
}
}
time
=
vlc_timegm
(
values
[
YEAR
]
-
1900
,
values
[
MON
]
-
1
,
values
[
DAY
],
t
=
vlc_timegm
(
values
[
YEAR
]
-
1900
,
values
[
MON
]
-
1
,
values
[
DAY
],
values
[
HOUR
],
values
[
MIN
],
values
[
SEC
]
);
values
[
HOUR
],
values
[
MIN
],
values
[
SEC
]
);
time
+=
values
[
TZ
]
*
3600
;
t
+=
values
[
TZ
]
*
60
;
t
*=
CLOCK_FREQ
;
t
+=
values
[
MSEC
]
*
1000
;
}
catch
(
int
)
{
}
catch
(
int
)
{
t
ime
=
0
;
t
=
0
;
}
}
}
}
UTCTime
::
operator
time_t
()
const
time_t
UTCTime
::
time
()
const
{
{
return
time
;
return
t
/
CLOCK_FREQ
;
}
mtime_t
UTCTime
::
mtime
()
const
{
return
t
;
}
}
modules/demux/adaptative/tools/Conversions.hpp
View file @
0fa3d858
...
@@ -42,10 +42,11 @@ class UTCTime
...
@@ -42,10 +42,11 @@ class UTCTime
{
{
public:
public:
UTCTime
(
const
std
::
string
&
);
UTCTime
(
const
std
::
string
&
);
operator
time_t
()
const
;
time_t
time
()
const
;
mtime_t
mtime
()
const
;
private:
private:
time_t
time
;
mtime_t
t
;
};
};
template
<
typename
T
>
class
Integer
template
<
typename
T
>
class
Integer
...
...
modules/demux/dash/mpd/IsoffMainParser.cpp
View file @
0fa3d858
...
@@ -117,7 +117,7 @@ void IsoffMainParser::parseMPDAttributes (MPD *mpd, xml::Node *node)
...
@@ -117,7 +117,7 @@ void IsoffMainParser::parseMPDAttributes (MPD *mpd, xml::Node *node)
it
=
attr
.
find
(
"availabilityStartTime"
);
it
=
attr
.
find
(
"availabilityStartTime"
);
if
(
it
!=
attr
.
end
())
if
(
it
!=
attr
.
end
())
mpd
->
availabilityStartTime
.
Set
(
UTCTime
(
it
->
second
));
mpd
->
availabilityStartTime
.
Set
(
UTCTime
(
it
->
second
)
.
time
()
);
it
=
attr
.
find
(
"timeShiftBufferDepth"
);
it
=
attr
.
find
(
"timeShiftBufferDepth"
);
if
(
it
!=
attr
.
end
())
if
(
it
!=
attr
.
end
())
...
...
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