Skip to content

Commit

Permalink
Avoid debug prints in the audio callback
Browse files Browse the repository at this point in the history
Since this is an interrupt, the CDC code will hang if nothing is reading
  • Loading branch information
Daft-Freak committed Nov 20, 2020
1 parent af11106 commit 8de36d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions mp3-stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ void MP3Stream::callback()
{
if(dataSize[curAudioBuf])
{
// recover from underrun
endSample = audioBuf[curAudioBuf] + dataSize[curAudioBuf];
blit::debug("recovered\n");
}
else
{
Expand Down Expand Up @@ -414,8 +414,9 @@ void MP3Stream::callback()
{
currentSample = audioBuf[curAudioBuf];
endSample = currentSample + dataSize[curAudioBuf];
if(currentSample == endSample)
blit::debug("underrun!\n");

// if(currentSample == endSample)
// no more samples available - underrun
}
}

Expand Down
7 changes: 4 additions & 3 deletions vorbis-stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ void VorbisStream::callback()
{
if(dataSize[curAudioBuf])
{
// recover from underrun
endSample = audioBuf[curAudioBuf] + dataSize[curAudioBuf];
blit::debug("recovered\n");
}
else
{
Expand All @@ -283,8 +283,9 @@ void VorbisStream::callback()
{
currentSample = audioBuf[curAudioBuf];
endSample = currentSample + dataSize[curAudioBuf];
if(currentSample == endSample)
blit::debug("underrun!\n");

// if(currentSample == endSample)
// no more samples available - underrun
}
}

Expand Down

0 comments on commit 8de36d1

Please sign in to comment.