MCPcopy Create free account
hub / github.com/defold/defold / PrepTempBufferState

Function PrepTempBufferState

engine/sound/src/sound.cpp:1380–1394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1378 }
1379
1380 static inline void PrepTempBufferState(SoundInstance* instance, uint32_t channels)
1381 {
1382 if (instance->m_FrameCount > 0)
1383 {
1384 // Bring back history and any still available samples (possible left over sample & 'future' samples as available)
1385 assert(instance->m_FrameCount >= SOUND_MAX_HISTORY);
1386 uint32_t state_bytes = instance->m_FrameCount * sizeof(float);
1387
1388 for(uint32_t c=0; c<channels; ++c)
1389 {
1390 float* decoder_output_buffer = g_SoundSystem->GetDecoderBufferBase(c);
1391 memcpy((void*)(decoder_output_buffer - SOUND_MAX_HISTORY), instance->m_Frames[c], state_bytes);
1392 }
1393 }
1394 }
1395
1396 static inline void SaveTempBufferState(SoundInstance* instance, uint32_t avail_framecount, uint32_t used_framecount, uint32_t channels)
1397 {

Callers 2

MixResampleIdentityFunction · 0.85
MixResamplePolyphaseFunction · 0.85

Calls 2

GetDecoderBufferBaseMethod · 0.80
assertFunction · 0.50

Tested by

no test coverage detected