Commit e59c11393b3c30b29bbf3176f2771cfae9b5cd1f
1 parent
32d448c4
make the number of buffers settable (malc)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1638 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
5 additions
and
1 deletions
audio/coreaudio.c
| ... | ... | @@ -33,9 +33,11 @@ |
| 33 | 33 | |
| 34 | 34 | struct { |
| 35 | 35 | int buffer_frames; |
| 36 | + int nbuffers; | |
| 36 | 37 | int isAtexit; |
| 37 | 38 | } conf = { |
| 38 | 39 | .buffer_frames = 512, |
| 40 | + .nbuffers = 4, | |
| 39 | 41 | .isAtexit = 0 |
| 40 | 42 | }; |
| 41 | 43 | |
| ... | ... | @@ -393,7 +395,7 @@ static int coreaudio_init_out (HWVoiceOut *hw, audsettings_t *as) |
| 393 | 395 | "Could not get device buffer frame size\n"); |
| 394 | 396 | return -1; |
| 395 | 397 | } |
| 396 | - hw->samples = 4 * core->audioDevicePropertyBufferFrameSize; | |
| 398 | + hw->samples = conf.nbuffers * core->audioDevicePropertyBufferFrameSize; | |
| 397 | 399 | |
| 398 | 400 | /* get StreamFormat */ |
| 399 | 401 | propertySize = sizeof(core->outputStreamBasicDescription); |
| ... | ... | @@ -527,6 +529,8 @@ static void coreaudio_audio_fini (void *opaque) |
| 527 | 529 | static struct audio_option coreaudio_options[] = { |
| 528 | 530 | {"BUFFER_SIZE", AUD_OPT_INT, &conf.buffer_frames, |
| 529 | 531 | "Size of the buffer in frames", NULL, 0}, |
| 532 | + {"BUFFER_COUNT", AUD_OPT_INT, &conf.nbuffers, | |
| 533 | + "Number of buffers", NULL, 0}, | |
| 530 | 534 | {NULL, 0, NULL, NULL, NULL, 0} |
| 531 | 535 | }; |
| 532 | 536 | ... | ... |