@@ -321,12 +321,12 @@ typedef int (*vsnd_virtq_cb)(virtio_snd_state_t *, /* vsnd state */
321
321
uint32_t * /* response length */ );
322
322
323
323
/* 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 );
330
330
static void virtio_queue_notify_handler (virtio_snd_state_t * vsnd ,
331
331
int index , /* virtq index */
332
332
vsnd_virtq_cb cb );
@@ -625,15 +625,16 @@ static void virtio_snd_read_pcm_prepare(const virtio_snd_pcm_hdr_t *query,
625
625
INIT_LIST_HEAD (& props -> buf_queue_head );
626
626
props -> intermediate =
627
627
(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
+ };
634
635
PaError err = Pa_OpenStream (& props -> pa_stream , NULL , /* no input */
635
636
& params , rate , cnfa_period_frames , paClipOff ,
636
- virtio_snd_pa_cb , & props -> v );
637
+ virtio_snd_stream_cb , & props -> v );
637
638
if (err != paNoError ) {
638
639
fprintf (stderr , "Cannot create PortAudio\n" );
639
640
printf ("PortAudio error: %s\n" , Pa_GetErrorText (err ));
@@ -790,17 +791,17 @@ static void __virtio_snd_frame_dequeue(void *out,
790
791
pthread_mutex_unlock (& props -> lock .lock );
791
792
}
792
793
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 )
799
800
{
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 ;
801
802
uint32_t id = v_ptr -> stream_id ;
802
803
int channels = vsnd_props [id ].pp .channels ;
803
- uint32_t out_buf_sz = frameCount * channels ;
804
+ uint32_t out_buf_sz = frame_cnt * channels ;
804
805
uint32_t out_buf_bytes = out_buf_sz * VSND_CNFA_FRAME_SZ ;
805
806
__virtio_snd_frame_dequeue (output , out_buf_bytes , id );
806
807
0 commit comments