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
591efc80
Commit
591efc80
authored
Apr 09, 2014
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auhal: fix detection of disconnected airplay devices
parent
2bfcc58d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
11 deletions
+22
-11
modules/audio_output/auhal.c
modules/audio_output/auhal.c
+22
-11
No files found.
modules/audio_output/auhal.c
View file @
591efc80
...
...
@@ -324,18 +324,29 @@ static int Start(audio_output_t *p_aout, audio_sample_format_t *restrict fmt)
AudioObjectPropertyAddress
audioDeviceAliveAddress
=
{
kAudioDevicePropertyDeviceIsAlive
,
kAudioObjectPropertyScopeGlobal
,
kAudioObjectPropertyElementMaster
};
if
(
p_sys
->
i_selected_dev
>
0
)
{
/* Check if the desired device is alive and usable */
i_param_size
=
sizeof
(
b_alive
);
err
=
AudioObjectGetPropertyData
(
p_sys
->
i_selected_dev
,
&
audioDeviceAliveAddress
,
0
,
NULL
,
&
i_param_size
,
&
b_alive
);
if
(
err
!=
noErr
)
{
/* Be tolerant, only give a warning here */
msg_Warn
(
p_aout
,
"could not check whether device [0x%x] is alive [%4.4s]"
,
(
unsigned
int
)
p_sys
->
i_selected_dev
,
(
char
*
)
&
err
);
b_alive
=
false
;
}
if
(
!
b_alive
)
msg_Warn
(
p_aout
,
"selected audio device is not alive, switching to default device"
);
/* Check if device is in devices list. Only checking for kAudioDevicePropertyDeviceIsAlive is not sufficient,
* as a former airplay device might be already gone, but the device number might be still valid. Core Audio
* even says that this device would be alive. Don't ask why, its Core Audio. */
CFIndex
count
=
CFArrayGetCount
(
p_sys
->
device_list
);
if
(
CFArrayContainsValue
(
p_sys
->
device_list
,
CFRangeMake
(
0
,
count
),
CFNumberCreate
(
kCFAllocatorDefault
,
kCFNumberSInt32Type
,
&
p_sys
->
i_selected_dev
)))
{
/* Check if the desired device is alive and usable */
i_param_size
=
sizeof
(
b_alive
);
err
=
AudioObjectGetPropertyData
(
p_sys
->
i_selected_dev
,
&
audioDeviceAliveAddress
,
0
,
NULL
,
&
i_param_size
,
&
b_alive
);
if
(
err
!=
noErr
)
{
/* Be tolerant, only give a warning here */
msg_Warn
(
p_aout
,
"could not check whether device [0x%x] is alive [%4.4s]"
,
(
unsigned
int
)
p_sys
->
i_selected_dev
,
(
char
*
)
&
err
);
b_alive
=
false
;
}
if
(
!
b_alive
)
msg_Warn
(
p_aout
,
"selected audio device is not alive, switching to default device"
);
}
else
{
msg_Warn
(
p_aout
,
"device id %i not found in the current devices list, fallback to default device"
,
p_sys
->
i_selected_dev
);
}
}
p_sys
->
b_selected_dev_is_default
=
false
;
...
...
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