Small fix to Player's stream resolution logic -- we should also return a

DynamicStream when the visualizer is hidden.
This commit is contained in:
casey langen 2016-12-03 15:18:16 -08:00
parent 896f8459df
commit 4600b801b6

View File

@ -190,7 +190,12 @@ int Player::State() {
}
void musik::core::audio::playerThreadLoop(Player* player) {
player->stream = vis::SelectedVisualizer()
/* if there's no visualizer active we'll use a DynamicStream, which allows
buffer sizes to vary. this type of stream is more CPU friendly because
we won't have to memcpy a bunch of audio data around. */
auto visualizer = vis::SelectedVisualizer();
player->stream = (visualizer && visualizer->Visible())
? Stream::Create() : DynamicStream::Create();
BufferPtr buffer;