Skip to content

Commit d989a67

Browse files
committed
update
1 parent 9023def commit d989a67

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

Diff for: virtio-snd.c

+22-21
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,12 @@ typedef int (*vsnd_virtq_cb)(virtio_snd_state_t *, /* vsnd state */
321321
uint32_t * /* response length */);
322322

323323
/* Forward declaration */
324-
static int virtio_snd_pa_cb(const void *input,
325-
void *output,
326-
unsigned long frameCount,
327-
const PaStreamCallbackTimeInfo *timeInfo,
328-
PaStreamCallbackFlags statusFlags,
329-
void *userData);
324+
static int virtio_snd_stream_cb(const void *input,
325+
void *output,
326+
unsigned long frame_cnt,
327+
const PaStreamCallbackTimeInfo *time_info,
328+
PaStreamCallbackFlags status_flags,
329+
void *user_data);
330330
static void virtio_queue_notify_handler(virtio_snd_state_t *vsnd,
331331
int index, /* virtq index */
332332
vsnd_virtq_cb cb);
@@ -625,15 +625,16 @@ static void virtio_snd_read_pcm_prepare(const virtio_snd_pcm_hdr_t *query,
625625
INIT_LIST_HEAD(&props->buf_queue_head);
626626
props->intermediate =
627627
(void *) malloc(sizeof(*props->intermediate) * cnfa_period_bytes);
628-
PaStreamParameters params;
629-
params.device = Pa_GetDefaultOutputDevice();
630-
params.channelCount = props->pp.channels;
631-
params.sampleFormat = paInt16;
632-
params.suggestedLatency = 0.1; /* 100 ms */
633-
params.hostApiSpecificStreamInfo = NULL;
628+
PaStreamParameters params = {
629+
.device = Pa_GetDefaultOutputDevice(),
630+
.channelCount = props->pp.channels,
631+
.sampleFormat = paInt16,
632+
.suggestedLatency = 0.1, /* 100 ms */
633+
.hostApiSpecificStreamInfo = NULL,
634+
};
634635
PaError err = Pa_OpenStream(&props->pa_stream, NULL, /* no input */
635636
&params, rate, cnfa_period_frames, paClipOff,
636-
virtio_snd_pa_cb, &props->v);
637+
virtio_snd_stream_cb, &props->v);
637638
if (err != paNoError) {
638639
fprintf(stderr, "Cannot create PortAudio\n");
639640
printf("PortAudio error: %s\n", Pa_GetErrorText(err));
@@ -790,17 +791,17 @@ static void __virtio_snd_frame_dequeue(void *out,
790791
pthread_mutex_unlock(&props->lock.lock);
791792
}
792793

793-
static int virtio_snd_pa_cb(const void *input,
794-
void *output,
795-
unsigned long frameCount,
796-
const PaStreamCallbackTimeInfo *timeInfo,
797-
PaStreamCallbackFlags statusFlags,
798-
void *userData)
794+
static int virtio_snd_stream_cb(const void *input,
795+
void *output,
796+
unsigned long frame_cnt,
797+
const PaStreamCallbackTimeInfo *time_info,
798+
PaStreamCallbackFlags status_flags,
799+
void *user_data)
799800
{
800-
vsnd_stream_sel_t *v_ptr = (vsnd_stream_sel_t *) userData;
801+
vsnd_stream_sel_t *v_ptr = (vsnd_stream_sel_t *) user_data;
801802
uint32_t id = v_ptr->stream_id;
802803
int channels = vsnd_props[id].pp.channels;
803-
uint32_t out_buf_sz = frameCount * channels;
804+
uint32_t out_buf_sz = frame_cnt * channels;
804805
uint32_t out_buf_bytes = out_buf_sz * VSND_CNFA_FRAME_SZ;
805806
__virtio_snd_frame_dequeue(output, out_buf_bytes, id);
806807

0 commit comments

Comments
 (0)