Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
e4b9d679
Commit
e4b9d679
authored
Sep 18, 2016
by
Yue Wang
Committed by
GitHub
Sep 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
options for sample rate syncing and device hogging
parent
2bf2bd89
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
OSXOutputPlugin.cxx
src/output/plugins/OSXOutputPlugin.cxx
+9
-3
No files found.
src/output/plugins/OSXOutputPlugin.cxx
View file @
e4b9d679
...
...
@@ -41,6 +41,8 @@ struct OSXOutput {
/* only applicable with kAudioUnitSubType_HALOutput */
const
char
*
device_name
;
const
char
*
channel_map
;
bool
hog_device
;
bool
sync_sample_rate
;
AudioDeviceID
dev_id
;
AudioComponentInstance
au
;
...
...
@@ -101,6 +103,8 @@ osx_output_configure(OSXOutput *oo, const ConfigBlock &block)
}
oo
->
channel_map
=
block
.
GetBlockValue
(
"channel_map"
);
oo
->
hog_device
=
block
.
GetBlockValue
(
"hog_device"
,
false
);
oo
->
sync_sample_rate
=
block
.
GetBlockValue
(
"sync_sample_rate"
,
false
);
}
static
AudioOutput
*
...
...
@@ -631,7 +635,7 @@ osx_output_enable(AudioOutput *ao, Error &error)
return
false
;
}
if
(
oo
->
component_subtype
==
kAudioUnitSubType_HALOutput
)
{
if
(
oo
->
hog_device
)
{
osx_output_hog_device
(
oo
->
dev_id
,
true
);
}
...
...
@@ -661,7 +665,7 @@ osx_output_disable(AudioOutput *ao)
AudioComponentInstanceDispose
(
oo
->
au
);
if
(
oo
->
component_subtype
==
kAudioUnitSubType_HALOutput
)
{
if
(
oo
->
hog_device
)
{
osx_output_hog_device
(
oo
->
dev_id
,
false
);
}
}
...
...
@@ -717,7 +721,9 @@ osx_output_open(AudioOutput *ao, AudioFormat &audio_format,
od
->
asbd
.
mBytesPerFrame
=
od
->
asbd
.
mBytesPerPacket
;
od
->
asbd
.
mChannelsPerFrame
=
audio_format
.
channels
;
osx_output_sync_device_sample_rate
(
od
->
dev_id
,
od
->
asbd
);
if
(
od
->
sync_sample_rate
)
{
osx_output_sync_device_sample_rate
(
od
->
dev_id
,
od
->
asbd
);
}
OSStatus
status
=
AudioUnitSetProperty
(
od
->
au
,
kAudioUnitProperty_StreamFormat
,
...
...
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