ugly workaround, create a new pool for each input mix buffer,

to avoid running out of default pool memory. It would be much
better if a pool would grow if more memory is requested than
available.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3729 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
beveloper 2003-06-29 01:17:52 +00:00
parent dfe7be41fb
commit 356855c3f6
2 changed files with 9 additions and 1 deletions

View File

@ -25,6 +25,7 @@ MixerInput::MixerInput(MixerCore *core, const media_input &input, float mixFrame
fMixBufferFrameRate(0),
fMixBufferFrameCount(0),
fResampler(0),
fRtmPool(0),
fUserOverridesChannelDesignations(false)
{
fix_multiaudio_format(&fInput.format.u.raw_audio);
@ -76,6 +77,8 @@ MixerInput::~MixerInput()
{
if (fMixBuffer)
rtm_free(fMixBuffer);
if (fRtmPool)
rtm_delete_pool(fRtmPool);
delete [] fInputChannelInfo;
delete [] fMixerChannelInfo;
@ -456,8 +459,12 @@ MixerInput::SetMixBufferFormat(int32 framerate, int32 frames)
if (fMixBuffer)
rtm_free(fMixBuffer);
if (fRtmPool)
rtm_delete_pool(fRtmPool);
int size = sizeof(float) * fInputChannelCount * fMixBufferFrameCount;
fMixBuffer = (float *)rtm_alloc(NULL, size);
if (B_OK != rtm_create_pool(&fRtmPool, size))
fRtmPool = 0;
fMixBuffer = (float *)rtm_alloc(fRtmPool, size);
ASSERT(fMixBuffer);
memset(fMixBuffer, 0, size);

View File

@ -67,6 +67,7 @@ private:
uint32 fMixBufferFrameCount;
Resampler **fResampler; // array
rtm_pool *fRtmPool;
bool fUserOverridesChannelDesignations;