Skip to content

Commit

Permalink
Get the buffer after the driver has been initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
drfiemost committed Dec 8, 2024
1 parent a60da93 commit 7a12f04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -949,10 +949,10 @@ bool ConsolePlayer::play()
updateDisplay();

// Fill buffer
short *buffer = m_driver.selected->buffer();
// getBufSize returns the number of frames
// multiply by number of channels to get the count of 16bit samples
const uint_least32_t length = getBufSize() * m_driver.cfg.channels;
short *buffer = m_driver.selected->buffer();
uint_least32_t samples = m_engine.play(buffer, length);
if ((samples < length) || !m_engine.isPlaying())
{
Expand Down

0 comments on commit 7a12f04

Please sign in to comment.