vbSetSamples fix
This commit is contained in:
parent
3afe0282c2
commit
a285065102
|
@ -664,9 +664,9 @@ VBAPI vbOnRead vbSetReadCallback(VB *sim, vbOnRead callback) {
|
||||||
|
|
||||||
/* Specify a new audio samples buffer */
|
/* Specify a new audio samples buffer */
|
||||||
VBAPI int vbSetSamples(VB *sim, void *samples, uint32_t capacity) {
|
VBAPI int vbSetSamples(VB *sim, void *samples, uint32_t capacity) {
|
||||||
if (capacity == 0 || capacity > 0x40000000)
|
if (samples != NULL && (capacity == 0 || capacity > 0x40000000))
|
||||||
return 1;
|
return 1;
|
||||||
sim->vsu.out.capacity = capacity;
|
sim->vsu.out.capacity = samples == NULL ? 0 : capacity;
|
||||||
sim->vsu.out.offset = 0;
|
sim->vsu.out.offset = 0;
|
||||||
sim->vsu.out.samples = samples;
|
sim->vsu.out.samples = samples;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue