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
66302e2c
Commit
66302e2c
authored
Jun 28, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wasapi: use one-time init rather than DllMain()
parent
2a6f4315
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
16 deletions
+11
-16
modules/audio_output/wasapi.c
modules/audio_output/wasapi.c
+11
-16
No files found.
modules/audio_output/wasapi.c
View file @
66302e2c
...
...
@@ -18,6 +18,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#define _WIN32_WINNT 0x600
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
...
...
@@ -35,25 +36,14 @@
#include <vlc_plugin.h>
#include "audio_output/mmdevice.h"
static
LARGE_INTEGER
freq
;
/* performance counters frequency */
BOOL
WINAPI
DllMain
(
HINSTANCE
,
DWORD
,
LPVOID
);
/* avoid warning */
BOOL
WINAPI
DllMain
(
HINSTANCE
dll
,
DWORD
reason
,
LPVOID
reserved
)
static
BOOL
CALLBACK
InitFreq
(
INIT_ONCE
*
once
,
void
*
param
,
void
**
context
)
{
(
void
)
dll
;
(
void
)
reserved
;
switch
(
reason
)
{
case
DLL_PROCESS_ATTACH
:
if
(
!
QueryPerformanceFrequency
(
&
freq
))
return
FALSE
;
break
;
}
return
TRUE
;
(
void
)
once
;
(
void
)
context
;
return
QueryPerformanceFrequency
(
param
);
}
static
LARGE_INTEGER
freq
;
/* performance counters frequency */
static
UINT64
GetQPC
(
void
)
{
LARGE_INTEGER
counter
;
...
...
@@ -355,6 +345,11 @@ static HRESULT Start(aout_stream_t *s, audio_sample_format_t *restrict fmt,
/* Fallback to other plugin until pass-through is implemented */
return
E_NOTIMPL
;
static
INIT_ONCE
freq_once
=
INIT_ONCE_STATIC_INIT
;
if
(
!
InitOnceExecuteOnce
(
&
freq_once
,
InitFreq
,
&
freq
,
NULL
))
return
E_FAIL
;
aout_stream_sys_t
*
sys
=
malloc
(
sizeof
(
*
sys
));
if
(
unlikely
(
sys
==
NULL
))
return
E_OUTOFMEMORY
;
...
...
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