Skip to content

Commit

Permalink
Avoid logging an ERR for an expected case
Browse files Browse the repository at this point in the history
  • Loading branch information
kcat committed Feb 3, 2025
1 parent e1920e6 commit 4b033c6
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,7 @@ HRESULT STDMETHODCALLTYPE Buffer::GetCurrentPosition(DWORD *playCursor, DWORD *w
{
pos = static_cast<ALuint>(ofs);
writecursor = format.nSamplesPerSec / mParent.getRefresh() * format.nBlockAlign;
writecursor += pos;
}
else
{
Expand All @@ -788,7 +789,7 @@ HRESULT STDMETHODCALLTYPE Buffer::GetCurrentPosition(DWORD *playCursor, DWORD *w
case AL_INITIAL: pos = mLastPos; break;
default: pos = 0;
}
writecursor = 0;
writecursor = pos;
}

/* FIXME: AFAIK, a non-looping buffer that stops on its own should have the
Expand All @@ -798,12 +799,8 @@ HRESULT STDMETHODCALLTYPE Buffer::GetCurrentPosition(DWORD *playCursor, DWORD *w
* Some testing should be done to see what happens. Wine always wraps the
* play cursor, so just do that for now.
*/
if(pos >= mBuffer->mData.size())
{
ERR(PREFIX "playpos > buf_size");
pos %= mBuffer->mData.size();
}
writecursor = (writecursor+pos) % mBuffer->mData.size();
pos %= mBuffer->mData.size();
writecursor %= mBuffer->mData.size();

DEBUG(PREFIX " pos = {}, write pos = {}", pos, writecursor);

Expand Down

0 comments on commit 4b033c6

Please sign in to comment.