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
07b5873d
Commit
07b5873d
authored
Jan 21, 2006
by
Derk-Jan Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* workaround for device drivers that do not support "kAudioDevicePropertyPreferredChannelLayout".
Grmbl @ Digidesign coders...
parent
b05d7cdf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
106 additions
and
91 deletions
+106
-91
modules/audio_output/auhal.c
modules/audio_output/auhal.c
+106
-91
No files found.
modules/audio_output/auhal.c
View file @
07b5873d
...
@@ -292,40 +292,49 @@ static int OpenAnalog( aout_instance_t *p_aout )
...
@@ -292,40 +292,49 @@ static int OpenAnalog( aout_instance_t *p_aout )
}
}
err
=
OpenAComponent
(
p_sys
->
au_component
,
&
p_sys
->
au_unit
);
err
=
OpenAComponent
(
p_sys
->
au_component
,
&
p_sys
->
au_unit
);
if
(
err
)
if
(
err
!=
noErr
)
{
{
msg_Warn
(
p_aout
,
"we cannot open our HAL component"
);
msg_Warn
(
p_aout
,
"we cannot open our HAL component"
);
return
VLC_FALSE
;
return
VLC_FALSE
;
}
}
/* Set the device we will use for this output unit */
/* Set the device we will use for this output unit */
verify_noerr
(
AudioUnitSetProperty
(
p_sys
->
au_unit
,
err
=
AudioUnitSetProperty
(
p_sys
->
au_unit
,
kAudioOutputUnitProperty_CurrentDevice
,
kAudioOutputUnitProperty_CurrentDevice
,
kAudioUnitScope_Global
,
kAudioUnitScope_Global
,
0
,
0
,
&
p_sys
->
i_selected_dev
,
&
p_sys
->
i_selected_dev
,
sizeof
(
AudioDeviceID
)));
sizeof
(
AudioDeviceID
));
if
(
err
!=
noErr
)
{
msg_Warn
(
p_aout
,
"we cannot select the audio device"
);
return
VLC_FALSE
;
}
/* Get the current format */
/* Get the current format */
i_param_size
=
sizeof
(
AudioStreamBasicDescription
);
i_param_size
=
sizeof
(
AudioStreamBasicDescription
);
verify_noerr
(
AudioUnitGetProperty
(
p_sys
->
au_unit
,
err
=
AudioUnitGetProperty
(
p_sys
->
au_unit
,
kAudioUnitProperty_StreamFormat
,
kAudioUnitProperty_StreamFormat
,
kAudioUnitScope_Input
,
kAudioUnitScope_Input
,
0
,
0
,
&
DeviceFormat
,
&
DeviceFormat
,
&
i_param_size
)
)
;
&
i_param_size
);
msg_Dbg
(
p_aout
,
STREAM_FORMAT_MSG
(
"current format is: "
,
DeviceFormat
)
);
if
(
err
!=
noErr
)
return
VLC_FALSE
;
else
msg_Dbg
(
p_aout
,
STREAM_FORMAT_MSG
(
"current format is: "
,
DeviceFormat
)
);
/* Get the channel layout of the device side of the unit (vlc -> unit -> device) */
/* Get the channel layout of the device side of the unit (vlc -> unit -> device) */
verify_noerr
(
AudioUnitGetPropertyInfo
(
p_sys
->
au_unit
,
err
=
AudioUnitGetPropertyInfo
(
p_sys
->
au_unit
,
kAudioDevicePropertyPreferredChannelLayout
,
kAudioDevicePropertyPreferredChannelLayout
,
kAudioUnitScope_Output
,
kAudioUnitScope_Output
,
0
,
0
,
&
i_param_size
,
&
i_param_size
,
NULL
)
)
;
NULL
);
if
(
err
==
noErr
)
{
layout
=
(
AudioChannelLayout
*
)
malloc
(
i_param_size
);
layout
=
(
AudioChannelLayout
*
)
malloc
(
i_param_size
);
verify_noerr
(
AudioUnitGetProperty
(
p_sys
->
au_unit
,
verify_noerr
(
AudioUnitGetProperty
(
p_sys
->
au_unit
,
...
@@ -416,6 +425,12 @@ static int OpenAnalog( aout_instance_t *p_aout )
...
@@ -416,6 +425,12 @@ static int OpenAnalog( aout_instance_t *p_aout )
}
}
}
}
if
(
layout
)
free
(
layout
);
if
(
layout
)
free
(
layout
);
}
else
{
msg_Warn
(
p_aout
,
"this driver does not support kAudioDevicePropertyPreferredChannelLayout. BAD DRIVER AUTHOR !!!"
);
p_aout
->
output
.
output
.
i_physical_channels
=
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
;
}
msg_Dbg
(
p_aout
,
"selected %d physical channels for device output"
,
aout_FormatNbChannels
(
&
p_aout
->
output
.
output
)
);
msg_Dbg
(
p_aout
,
"selected %d physical channels for device output"
,
aout_FormatNbChannels
(
&
p_aout
->
output
.
output
)
);
msg_Dbg
(
p_aout
,
"VLC will output: %s"
,
aout_FormatPrintChannels
(
&
p_aout
->
output
.
output
));
msg_Dbg
(
p_aout
,
"VLC will output: %s"
,
aout_FormatPrintChannels
(
&
p_aout
->
output
.
output
));
...
...
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