File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -601,18 +601,17 @@ static void virtio_snd_cb(struct CNFADriver *dev,
601601
602602 fprintf (stderr , "start to play\n" );
603603 int channels = dev -> channelsPlay ;
604- #if 0
605- /* TODO: apply lock on guest_playing */
606604 uint32_t id = v_ptr -> stream_id ;
607- int output_buf_sz = framesp * channels ;
605+ int out_buf_sz = framesp * channels ;
608606
609- if (!(playing )) {
610- memset (out , 0 , sizeof (short ) * output_buf_sz );
607+ /* if (!(playing)) {
608+ memset(out, 0, sizeof(short) * out_buf_sz );
611609 return;
612- }
610+ }*/
613611
614- memcpy (out , vsnd_props [id ].buf , output_buf_sz );
615- #endif
612+ /* TODO: add single consumer */
613+ memcpy (out , vsnd_props [id ].ring .buffer , out_buf_sz );
614+ #if 0
616615 for (int i = 0 ; i < framesp ; i ++ ) {
617616 // Shift phase, so we run at 440 Hz (A4)
618617 omega += (3.14159 * 2 * 440. ) / dev -> spsPlay ;
@@ -625,6 +624,7 @@ static void virtio_snd_cb(struct CNFADriver *dev,
625624 * (out ++ ) = value ;
626625 }
627626 }
627+ #endif
628628 fprintf (stderr , "totalframesp %d totalframesr %d\n" , totalframesp ,
629629 totalframesr );
630630
You can’t perform that action at this time.
0 commit comments