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
6c8ed420
Commit
6c8ed420
authored
Dec 04, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wasapi: fixes and simplifications
parent
fda36eca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
17 deletions
+6
-17
modules/audio_output/wasapi.c
modules/audio_output/wasapi.c
+6
-17
No files found.
modules/audio_output/wasapi.c
View file @
6c8ed420
...
...
@@ -100,7 +100,6 @@ static HRESULT TimeGet(aout_api_t *api, mtime_t *restrict delay)
UINT64
pos
,
qpcpos
;
HRESULT
hr
;
Enter
();
hr
=
IAudioClient_GetService
(
sys
->
client
,
&
IID_IAudioClock
,
&
pv
);
if
(
SUCCEEDED
(
hr
))
{
...
...
@@ -113,7 +112,6 @@ static HRESULT TimeGet(aout_api_t *api, mtime_t *restrict delay)
}
else
msg_Err
(
api
,
"cannot get clock (error 0x%lx)"
,
hr
);
Leave
();
if
(
SUCCEEDED
(
hr
))
{
...
...
@@ -142,7 +140,6 @@ static HRESULT Play(aout_api_t *api, block_t *block)
aout_ChannelReorder
(
block
->
p_buffer
,
block
->
i_buffer
,
sys
->
chans_to_reorder
,
sys
->
chans_table
,
sys
->
bits
);
Enter
();
hr
=
IAudioClient_GetService
(
sys
->
client
,
&
IID_IAudioRenderClient
,
&
pv
);
if
(
FAILED
(
hr
))
{
...
...
@@ -198,7 +195,6 @@ static HRESULT Play(aout_api_t *api, block_t *block)
}
IAudioRenderClient_Release
(
render
);
out:
Leave
();
block_Release
(
block
);
return
hr
;
...
...
@@ -209,7 +205,6 @@ static HRESULT Pause(aout_api_t *api, bool paused)
aout_api_sys_t
*
sys
=
api
->
sys
;
HRESULT
hr
;
Enter
();
if
(
paused
)
hr
=
IAudioClient_Stop
(
sys
->
client
);
else
...
...
@@ -217,7 +212,6 @@ static HRESULT Pause(aout_api_t *api, bool paused)
if
(
FAILED
(
hr
))
msg_Warn
(
api
,
"cannot %s stream (error 0x%lx)"
,
paused
?
"stop"
:
"start"
,
hr
);
Leave
();
return
hr
;
}
...
...
@@ -226,11 +220,9 @@ static HRESULT Flush(aout_api_t *api)
aout_api_sys_t
*
sys
=
api
->
sys
;
HRESULT
hr
;
Enter
();
IAudioClient_Stop
(
sys
->
client
);
hr
=
IAudioClient_Reset
(
sys
->
client
);
Leave
();
hr
=
IAudioClient_Reset
(
sys
->
client
);
if
(
FAILED
(
hr
))
msg_Warn
(
api
,
"cannot reset stream (error 0x%lx)"
,
hr
);
else
...
...
@@ -339,11 +331,12 @@ static HRESULT Start(aout_api_t *api, audio_sample_format_t *restrict fmt,
return
E_OUTOFMEMORY
;
sys
->
client
=
NULL
;
void
*
pv
;
HRESULT
hr
;
Enter
();
void
*
pv
;
hr
=
IMMDevice_Activate
(
dev
,
&
IID_IAudioClient
,
CLSCTX_ALL
,
NULL
,
&
pv
);
Leave
();
if
(
FAILED
(
hr
))
{
msg_Err
(
api
,
"cannot activate client (error 0x%lx)"
,
hr
);
...
...
@@ -400,8 +393,6 @@ static HRESULT Start(aout_api_t *api, audio_sample_format_t *restrict fmt,
goto
error
;
}
Leave
();
sys
->
rate
=
fmt
->
i_rate
;
sys
->
bytes_per_frame
=
fmt
->
i_bytes_per_frame
;
sys
->
written
=
0
;
...
...
@@ -410,11 +401,11 @@ static HRESULT Start(aout_api_t *api, audio_sample_format_t *restrict fmt,
api
->
play
=
Play
;
api
->
pause
=
Pause
;
api
->
flush
=
Flush
;
return
VLC_SUCCESS
;
return
S_OK
;
error:
if
(
sys
->
client
!=
NULL
)
IAudioClient_Release
(
sys
->
client
);
Leave
(
);
free
(
sys
);
return
hr
;
}
...
...
@@ -422,10 +413,8 @@ static void Stop(aout_api_t *api)
{
aout_api_sys_t
*
sys
=
api
->
sys
;
Enter
();
IAudioClient_Stop
(
sys
->
client
);
/* should not be needed */
IAudioClient_Release
(
sys
->
client
);
Leave
();
}
#undef aout_api_Start
...
...
@@ -442,7 +431,7 @@ aout_api_t *aout_api_Start(vlc_object_t *parent, audio_sample_format_t *fmt,
vlc_object_release
(
api
);
api
=
NULL
;
}
return
NULL
;
return
api
;
}
void
aout_api_Stop
(
aout_api_t
*
api
)
...
...
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