提交 e59c1139 编写于 作者: B bellard

make the number of buffers settable (malc)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1638 c046a42c-6fe2-441c-8c8c-71466251a162
上级 32d448c4
...@@ -33,9 +33,11 @@ ...@@ -33,9 +33,11 @@
struct { struct {
int buffer_frames; int buffer_frames;
int nbuffers;
int isAtexit; int isAtexit;
} conf = { } conf = {
.buffer_frames = 512, .buffer_frames = 512,
.nbuffers = 4,
.isAtexit = 0 .isAtexit = 0
}; };
...@@ -393,7 +395,7 @@ static int coreaudio_init_out (HWVoiceOut *hw, audsettings_t *as) ...@@ -393,7 +395,7 @@ static int coreaudio_init_out (HWVoiceOut *hw, audsettings_t *as)
"Could not get device buffer frame size\n"); "Could not get device buffer frame size\n");
return -1; return -1;
} }
hw->samples = 4 * core->audioDevicePropertyBufferFrameSize; hw->samples = conf.nbuffers * core->audioDevicePropertyBufferFrameSize;
/* get StreamFormat */ /* get StreamFormat */
propertySize = sizeof(core->outputStreamBasicDescription); propertySize = sizeof(core->outputStreamBasicDescription);
...@@ -527,6 +529,8 @@ static void coreaudio_audio_fini (void *opaque) ...@@ -527,6 +529,8 @@ static void coreaudio_audio_fini (void *opaque)
static struct audio_option coreaudio_options[] = { static struct audio_option coreaudio_options[] = {
{"BUFFER_SIZE", AUD_OPT_INT, &conf.buffer_frames, {"BUFFER_SIZE", AUD_OPT_INT, &conf.buffer_frames,
"Size of the buffer in frames", NULL, 0}, "Size of the buffer in frames", NULL, 0},
{"BUFFER_COUNT", AUD_OPT_INT, &conf.nbuffers,
"Number of buffers", NULL, 0},
{NULL, 0, NULL, NULL, NULL, 0} {NULL, 0, NULL, NULL, NULL, 0}
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册