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
7697d8b2
Commit
7697d8b2
authored
Dec 06, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmdevice: deal with invalidated device in Start()
parent
c242a515
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
24 deletions
+20
-24
modules/audio_output/mmdevice.c
modules/audio_output/mmdevice.c
+12
-2
modules/audio_output/mmdevice.h
modules/audio_output/mmdevice.h
+4
-6
modules/audio_output/wasapi.c
modules/audio_output/wasapi.c
+4
-16
No files found.
modules/audio_output/mmdevice.c
View file @
7697d8b2
...
...
@@ -597,16 +597,25 @@ static void CloseDevice(audio_output_t *aout)
static
int
Start
(
audio_output_t
*
aout
,
audio_sample_format_t
*
restrict
fmt
)
{
aout_sys_t
*
sys
=
aout
->
sys
;
HRESULT
hr
;
assert
(
sys
->
stream
==
NULL
);
if
(
sys
->
dev
==
NULL
)
return
-
1
;
aout_stream_t
*
s
=
vlc_object_create
(
aout
,
sizeof
(
*
s
));
if
(
unlikely
(
s
==
NULL
))
return
-
1
;
EnterMTA
();
sys
->
stream
=
aout_stream_Start
(
aout
,
fmt
,
sys
->
dev
,
&
GUID_VLC_AUD_OUT
);
hr
=
aout_stream_Start
(
s
,
fmt
,
sys
->
dev
,
&
GUID_VLC_AUD_OUT
);
if
(
SUCCEEDED
(
hr
))
sys
->
stream
=
s
;
else
vlc_object_release
(
s
);
LeaveMTA
();
return
(
sys
->
stream
!=
NULL
)
?
0
:
-
1
;
return
vlc_FromHR
(
aout
,
hr
)
;
}
static
void
Stop
(
audio_output_t
*
aout
)
...
...
@@ -619,6 +628,7 @@ static void Stop(audio_output_t *aout)
aout_stream_Stop
(
sys
->
stream
);
LeaveMTA
();
vlc_object_release
(
sys
->
stream
);
sys
->
stream
=
NULL
;
}
...
...
modules/audio_output/mmdevice.h
View file @
7697d8b2
...
...
@@ -39,15 +39,13 @@ struct aout_stream
/**
* Creates an audio output stream on a given Windows multimedia device.
* \param
parent parent VLC object
* \param
s audio output stream object to be initialized
* \param fmt audio output sample format [IN/OUT]
* \param dev
audio
output device
* \param dev
MMDevice API
output device
* \param sid audio output session GUID [IN]
*/
aout_stream_t
*
aout_stream_Start
(
vlc_object_t
*
parent
,
audio_sample_format_t
*
fmt
,
HRESULT
aout_stream_Start
(
aout_stream_t
*
s
,
audio_sample_format_t
*
fmt
,
IMMDevice
*
dev
,
const
GUID
*
sid
);
#define aout_stream_Start(o,f,d,s) aout_stream_Start(VLC_OBJECT(o),f,d,s)
/**
* Destroys an audio output stream.
...
...
modules/audio_output/wasapi.c
View file @
7697d8b2
...
...
@@ -403,26 +403,14 @@ static void Stop(aout_stream_t *s)
IAudioClient_Release
(
sys
->
client
);
}
#undef aout_stream_Start
aout_stream_t
*
aout_stream_Start
(
vlc_object_t
*
parent
,
HRESULT
aout_stream_Start
(
aout_stream_t
*
s
,
audio_sample_format_t
*
restrict
fmt
,
IMMDevice
*
dev
,
const
GUID
*
sid
)
{
aout_stream_t
*
s
=
vlc_object_create
(
parent
,
sizeof
(
*
s
));
if
(
unlikely
(
s
==
NULL
))
return
NULL
;
HRESULT
hr
=
Start
(
s
,
fmt
,
dev
,
sid
);
if
(
FAILED
(
hr
))
{
vlc_object_release
(
s
);
s
=
NULL
;
}
return
s
;
return
Start
(
s
,
fmt
,
dev
,
sid
);
}
void
aout_stream_Stop
(
aout_stream_t
*
s
)
{
Stop
(
s
);
vlc_object_release
(
s
);
}
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