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
aa73cad3
Commit
aa73cad3
authored
Dec 24, 2012
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auhal: clean-up HardwareListener callback
parent
58a31eb2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
17 deletions
+27
-17
modules/audio_output/auhal.c
modules/audio_output/auhal.c
+27
-17
No files found.
modules/audio_output/auhal.c
View file @
aa73cad3
...
@@ -823,13 +823,13 @@ static void Stop(audio_output_t *p_aout)
...
@@ -823,13 +823,13 @@ static void Stop(audio_output_t *p_aout)
UInt32
i_param_size
=
0
;
UInt32
i_param_size
=
0
;
AudioObjectPropertyAddress
deviceAliveAddress
=
{
kAudioDevicePropertyDeviceIsAlive
,
kAudioObjectPropertyScopeGlobal
,
kAudioObjectPropertyElementMaster
};
AudioObjectPropertyAddress
deviceAliveAddress
=
{
kAudioDevicePropertyDeviceIsAlive
,
kAudioObjectPropertyScopeGlobal
,
kAudioObjectPropertyElementMaster
};
err
=
AudioObjectRemovePropertyListener
(
p_sys
->
i_selected_dev
,
&
deviceAliveAddress
,
HardwareListener
,
NULL
);
err
=
AudioObjectRemovePropertyListener
(
p_sys
->
i_selected_dev
,
&
deviceAliveAddress
,
HardwareListener
,
(
void
*
)
p_aout
);
if
(
err
!=
noErr
)
if
(
err
!=
noErr
)
msg_Err
(
p_aout
,
"failed to remove audio device life checker: [%4.4s]"
,
(
char
*
)
&
err
);
msg_Err
(
p_aout
,
"failed to remove audio device life checker: [%4.4s]"
,
(
char
*
)
&
err
);
if
(
p_sys
->
b_digital
)
{
if
(
p_sys
->
b_digital
)
{
AudioObjectPropertyAddress
physicalFormatsAddress
=
{
kAudioStreamPropertyAvailablePhysicalFormats
,
kAudioObjectPropertyScopeGlobal
,
0
};
AudioObjectPropertyAddress
physicalFormatsAddress
=
{
kAudioStreamPropertyAvailablePhysicalFormats
,
kAudioObjectPropertyScopeGlobal
,
0
};
err
=
AudioObjectRemovePropertyListener
(
p_sys
->
i_stream_id
,
&
physicalFormatsAddress
,
HardwareListener
,
NULL
);
err
=
AudioObjectRemovePropertyListener
(
p_sys
->
i_stream_id
,
&
physicalFormatsAddress
,
HardwareListener
,
(
void
*
)
p_aout
);
if
(
err
!=
noErr
)
if
(
err
!=
noErr
)
msg_Err
(
p_aout
,
"failed to remove audio device property streams callback: [%4.4s]"
,
(
char
*
)
&
err
);
msg_Err
(
p_aout
,
"failed to remove audio device property streams callback: [%4.4s]"
,
(
char
*
)
&
err
);
}
}
...
@@ -876,7 +876,7 @@ static void Stop(audio_output_t *p_aout)
...
@@ -876,7 +876,7 @@ static void Stop(audio_output_t *p_aout)
}
}
AudioObjectPropertyAddress
audioDevicesAddress
=
{
kAudioHardwarePropertyDevices
,
kAudioObjectPropertyScopeGlobal
,
kAudioObjectPropertyElementMaster
};
AudioObjectPropertyAddress
audioDevicesAddress
=
{
kAudioHardwarePropertyDevices
,
kAudioObjectPropertyScopeGlobal
,
kAudioObjectPropertyElementMaster
};
err
=
AudioObjectRemovePropertyListener
(
kAudioObjectSystemObject
,
&
audioDevicesAddress
,
HardwareListener
,
NULL
);
err
=
AudioObjectRemovePropertyListener
(
kAudioObjectSystemObject
,
&
audioDevicesAddress
,
HardwareListener
,
(
void
*
)
p_aout
);
if
(
err
!=
noErr
)
if
(
err
!=
noErr
)
msg_Err
(
p_aout
,
"AudioHardwareRemovePropertyListener failed: [%4.4s]"
,
(
char
*
)
&
err
);
msg_Err
(
p_aout
,
"AudioHardwareRemovePropertyListener failed: [%4.4s]"
,
(
char
*
)
&
err
);
...
@@ -1359,23 +1359,33 @@ static OSStatus HardwareListener(AudioObjectID inObjectID, UInt32 inNumberAddre
...
@@ -1359,23 +1359,33 @@ static OSStatus HardwareListener(AudioObjectID inObjectID, UInt32 inNumberAddre
audio_output_t
*
p_aout
=
(
audio_output_t
*
)
inClientData
;
audio_output_t
*
p_aout
=
(
audio_output_t
*
)
inClientData
;
VLC_UNUSED
(
inObjectID
);
VLC_UNUSED
(
inObjectID
);
if
(
!
p_aout
)
return
-
1
;
#ifndef NDEBUG
for
(
unsigned
int
i
=
0
;
i
<
inNumberAddresses
;
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
inNumberAddresses
;
i
++
)
{
if
(
inAddresses
[
i
].
mSelector
==
kAudioHardwarePropertyDevices
)
{
switch
(
inAddresses
[
i
].
mSelector
)
{
/* something changed in the list of devices */
case
kAudioHardwarePropertyDevices
:
/* We trigger the audio-device's aout_ChannelsRestart callback */
msg_Warn
(
p_aout
,
"audio device configuration changed, resetting cache"
);
msg_Warn
(
p_aout
,
"audio device configuration changed, resetting cache"
);
break
;
var_TriggerCallback
(
p_aout
,
"audio-device"
);
var_Destroy
(
p_aout
,
"audio-device"
);
case
kAudioDevicePropertyDeviceIsAlive
:
}
else
if
(
inAddresses
[
i
].
mSelector
==
kAudioDevicePropertyDeviceIsAlive
)
{
msg_Warn
(
p_aout
,
"audio device died, resetting aout"
);
msg_Warn
(
p_aout
,
"audio device died, resetting aout"
);
break
;
var_TriggerCallback
(
p_aout
,
"audio-device"
);
var_Destroy
(
p_aout
,
"audio-device"
);
case
kAudioStreamPropertyAvailablePhysicalFormats
:
}
else
if
(
inAddresses
[
i
].
mSelector
==
kAudioStreamPropertyAvailablePhysicalFormats
)
{
msg_Warn
(
p_aout
,
"available physical formats for audio device changed, resetting aout"
);
msg_Warn
(
p_aout
,
"available physical formats for audio device changed, resetting aout"
);
break
;
var_TriggerCallback
(
p_aout
,
"audio-device"
);
var_Destroy
(
p_aout
,
"audio-device"
);
default:
msg_Warn
(
p_aout
,
"device reset for unknown reason (%i)"
,
inAddresses
[
i
].
mSelector
);
break
;
}
}
}
}
#endif
var_TriggerCallback
(
p_aout
,
"audio-device"
);
var_Destroy
(
p_aout
,
"audio-device"
);
return
err
;
return
err
;
}
}
...
...
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