Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
5ed7f840
Commit
5ed7f840
authored
Apr 17, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32: query performance timer frequency just once at start
parent
212b20dd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
src/win32/thread.c
src/win32/thread.c
+6
-4
No files found.
src/win32/thread.c
View file @
5ed7f840
...
@@ -61,6 +61,7 @@ struct vlc_thread
...
@@ -61,6 +61,7 @@ struct vlc_thread
void
*
data
;
void
*
data
;
};
};
static
LARGE_INTEGER
freq
;
static
vlc_mutex_t
super_mutex
;
static
vlc_mutex_t
super_mutex
;
static
vlc_cond_t
super_variable
;
static
vlc_cond_t
super_variable
;
extern
vlc_rwlock_t
config_lock
,
msg_lock
;
extern
vlc_rwlock_t
config_lock
,
msg_lock
;
...
@@ -75,6 +76,8 @@ BOOL WINAPI DllMain (HINSTANCE hinstDll, DWORD fdwReason, LPVOID lpvReserved)
...
@@ -75,6 +76,8 @@ BOOL WINAPI DllMain (HINSTANCE hinstDll, DWORD fdwReason, LPVOID lpvReserved)
switch
(
fdwReason
)
switch
(
fdwReason
)
{
{
case
DLL_PROCESS_ATTACH
:
case
DLL_PROCESS_ATTACH
:
if
(
!
QueryPerformanceFrequency
(
&
freq
))
return
FALSE
;
vlc_mutex_init
(
&
super_mutex
);
vlc_mutex_init
(
&
super_mutex
);
vlc_cond_init
(
&
super_variable
);
vlc_cond_init
(
&
super_variable
);
vlc_threadvar_create
(
&
thread_key
,
NULL
);
vlc_threadvar_create
(
&
thread_key
,
NULL
);
...
@@ -771,10 +774,9 @@ void vlc_control_cancel (int cmd, ...)
...
@@ -771,10 +774,9 @@ void vlc_control_cancel (int cmd, ...)
mtime_t
mdate
(
void
)
mtime_t
mdate
(
void
)
{
{
/* We don't need the real date, just the value of a high precision timer */
/* We don't need the real date, just the value of a high precision timer */
LARGE_INTEGER
counter
,
freq
;
LARGE_INTEGER
counter
;
if
(
!
QueryPerformanceCounter
(
&
counter
)
if
(
!
QueryPerformanceCounter
(
&
counter
))
||
!
QueryPerformanceFrequency
(
&
freq
))
abort
();
abort
();
/* Convert to from (1/freq) to microsecond resolution */
/* Convert to from (1/freq) to microsecond resolution */
/* We need to split the division to avoid 63-bits overflow */
/* We need to split the division to avoid 63-bits overflow */
...
...
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