fix in Linux audio interface
This commit is contained in:
parent
347befce8d
commit
1c77e542aa
1 changed files with 14 additions and 10 deletions
|
@ -212,7 +212,7 @@ bool CSound::Write ( CVector<short>& psData )
|
|||
}
|
||||
else if ( ret == -EAGAIN )
|
||||
{
|
||||
if ( ( ret = snd_pcm_wait ( phandle, 1 ) ) < 0 )
|
||||
if ( ( ret = snd_pcm_wait ( phandle, 1000 ) ) < 0 )
|
||||
{
|
||||
qDebug ( "poll failed (%s)", snd_strerror ( ret ) );
|
||||
break;
|
||||
|
@ -247,9 +247,12 @@ bool CSound::Write ( CVector<short>& psData )
|
|||
break; // skip one period
|
||||
}
|
||||
|
||||
if ( ret > 0 )
|
||||
{
|
||||
size -= ret;
|
||||
start += ret;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -356,7 +359,8 @@ bool CSound::SetHWParams ( snd_pcm_t* handle, const int iBufferSizeIn,
|
|||
|
||||
// check period and buffer size
|
||||
snd_pcm_uframes_t buffer_size;
|
||||
if ( err = snd_pcm_hw_params_get_buffer_size(hwparams, &buffer_size ) < 0 ) {
|
||||
if ( err = snd_pcm_hw_params_get_buffer_size(hwparams, &buffer_size ) < 0 )
|
||||
{
|
||||
qDebug ( "Unable to get buffer size for playback: %s\n", snd_strerror ( err ) );
|
||||
}
|
||||
qDebug ( "buffer size: %d (desired: %d)", (int) buffer_size, iBufferSizeIn * iNumPeriodBlocks );
|
||||
|
|
Loading…
Reference in a new issue