Make sure buffer is large enough to handle all the frames. Patch from Jindrich Makovicka, bug 2799116.
This commit is contained in:
@@ -54,8 +54,17 @@ bool RageSoundDriver_ALSA9_Software::GetData()
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
static int16_t *buf = NULL;
|
static int16_t *buf = NULL;
|
||||||
if (!buf)
|
static int bufsize = 0;
|
||||||
buf = new int16_t[g_iMaxWriteahead*samples_per_frame];
|
if( buf && bufsize < frames_to_fill )
|
||||||
|
{
|
||||||
|
delete[] buf;
|
||||||
|
buf = NULL;
|
||||||
|
}
|
||||||
|
if( !buf )
|
||||||
|
{
|
||||||
|
buf = new int16_t[frames_to_fill*samples_per_frame];
|
||||||
|
bufsize = frames_to_fill;
|
||||||
|
}
|
||||||
|
|
||||||
const int64_t play_pos = m_pPCM->GetPlayPos();
|
const int64_t play_pos = m_pPCM->GetPlayPos();
|
||||||
const int64_t cur_play_pos = m_pPCM->GetPosition();
|
const int64_t cur_play_pos = m_pPCM->GetPosition();
|
||||||
|
|||||||
Reference in New Issue
Block a user