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
688f5db3
Commit
688f5db3
authored
Sep 12, 2013
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auhal: ignore invalid default audio device changes (fixes #9374)
parent
ae871faa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
modules/audio_output/auhal.c
modules/audio_output/auhal.c
+25
-2
No files found.
modules/audio_output/auhal.c
View file @
688f5db3
...
...
@@ -1565,9 +1565,32 @@ static OSStatus DefaultDeviceChangedListener(AudioObjectID inObjectID, UInt32 i
return
-
1
;
if
(
!
p_aout
->
sys
->
b_selected_dev_is_default
)
return
0
;
return
noErr
;
AudioObjectID
defaultDeviceID
=
0
;
UInt32
propertySize
=
sizeof
(
AudioObjectID
);
AudioObjectPropertyAddress
defaultDeviceAddress
=
{
kAudioHardwarePropertyDefaultOutputDevice
,
kAudioDevicePropertyScopeOutput
,
kAudioObjectPropertyElementMaster
};
propertySize
=
sizeof
(
AudioObjectID
);
OSStatus
err
=
AudioObjectGetPropertyData
(
kAudioObjectSystemObject
,
&
defaultDeviceAddress
,
0
,
NULL
,
&
propertySize
,
&
defaultDeviceID
);
if
(
err
!=
noErr
)
{
msg_Err
(
p_aout
,
"could not get default audio device [%4.4s]"
,
(
char
*
)
&
err
);
return
-
1
;
}
msg_Dbg
(
p_aout
,
"default device changed to %i"
,
defaultDeviceID
);
/*
* The default device id changes to 0 when switching to SPDIF for whatever reason.
* We need to ignore that.
*/
if
(
defaultDeviceID
==
0
)
return
noErr
;
/* Also ignore events which announce the same device id */
if
(
defaultDeviceID
==
p_aout
->
sys
->
i_selected_dev
)
return
noErr
;
msg_Dbg
(
p_aout
,
"default device changed, resetting aout"
);
msg_Dbg
(
p_aout
,
"default device
actually
changed, resetting aout"
);
aout_RestartRequest
(
p_aout
,
AOUT_RESTART_OUTPUT
);
return
noErr
;
...
...
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