Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Robert Stone
VLC
Commits
af03afe3
Commit
af03afe3
authored
6 years ago
by
Hugo Beauzée-Luyssen
Browse files
Options
Downloads
Patches
Plain Diff
vlc_ticks: Simplify C++ integer variants of vlc_tick_from_sec
parent
381304e2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/vlc_tick.h
+6
-9
6 additions, 9 deletions
include/vlc_tick.h
with
6 additions
and
9 deletions
include/vlc_tick.h
+
6
−
9
View file @
af03afe3
...
...
@@ -53,18 +53,15 @@ typedef vlc_tick_t mtime_t; /* deprecated, use vlc_tick_t */
#define SEC_FROM_VLC_TICK(vtk) ((vtk) / CLOCK_FREQ)
#ifdef __cplusplus
static
inline
vlc_tick_t
vlc_tick_from_sec
(
int64_t
sec
)
{
return
CLOCK_FREQ
*
sec
;
}
static
inline
vlc_tick_t
vlc_tick_from_sec
(
int
sec
)
{
return
CLOCK_FREQ
*
sec
;
}
static
inline
vlc_tick_t
vlc_tick_from_sec
(
uint32_t
sec
)
#include
<type_traits>
template
<
typename
T
>
static
inline
auto
vlc_tick_from_sec
(
T
sec
)
->
typename
std
::
enable_if
<
std
::
is_integral
<
T
>::
value
,
vlc_tick_t
>::
type
{
return
CLOCK_FREQ
*
sec
;
}
/* seconds in floating point */
static
inline
vlc_tick_t
vlc_tick_from_sec
(
double
secf
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment