diff options
author | Yue Wang <Wang-Yue@users.noreply.github.com> | 2018-07-28 00:06:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-28 00:06:56 -0700 |
commit | 1e88e71b9a775a0e1bb2100378b1d7880ce237dc (patch) | |
tree | 70a68c77ec4f2f1fd001dd016fabab8c54c66a62 /src/output | |
parent | e16fd4a09b7af5dc1501e996573881f4b3975d67 (diff) |
[OSXOutputPlugin] Fix a bug that the stream sample rate is missing
the code here tried to guard DSD features behind ENABLE_DSD. However, the sample rate setting should be shared between two scenarios.
https://github.com/MusicPlayerDaemon/MPD/commit/40a1ebee295c569521ea17ffdedc641d1aedd9cb#diff-ce7ecec9ea9ca3df90d9c290cb3ef9d4R795
The code runs fine if the dac supports the sample rate, as Mac OS will use the device rate if stream rate is 0.
However, when DAC is uncapable of processing the sample rate, a wrong rate (device rate) will be used for the stream rate.
Diffstat (limited to 'src/output')
-rw-r--r-- | src/output/plugins/OSXOutputPlugin.cxx | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/output/plugins/OSXOutputPlugin.cxx b/src/output/plugins/OSXOutputPlugin.cxx index 9894eff25..3ae760671 100644 --- a/src/output/plugins/OSXOutputPlugin.cxx +++ b/src/output/plugins/OSXOutputPlugin.cxx @@ -777,6 +777,7 @@ OSXOutput::Open(AudioFormat &audio_format) asbd.mBitsPerChannel = audio_format.GetSampleSize() * 8; } asbd.mBytesPerPacket = audio_format.GetFrameSize(); + asbd.mSampleRate = audio_format.sample_rate; #ifdef ENABLE_DSD if (dop && audio_format.format == SampleFormat::DSD) { |