Skip to content

Commit 57340b8

Browse files
committed
Move comment
1 parent 188115c commit 57340b8

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

virtio-snd.c

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -585,21 +585,6 @@ static void virtio_snd_cb(struct CNFADriver *dev,
585585
int framesr)
586586
{
587587
(void) in; /* reversed for future recording use */
588-
#if 0
589-
/* TODO: apply lock on guest_playing */
590-
vsnd_stream_sel_t *v_ptr = (vsnd_stream_sel_t *) dev->opaque;
591-
bool playing = v_ptr->guest_playing;
592-
uint32_t id = v_ptr->stream_id;
593-
int output_channels = dev->channelsPlay;
594-
int output_buf_sz = framesp * output_channels;
595-
596-
if (!(playing)) {
597-
memset(out, 0, sizeof(short) * output_buf_sz);
598-
return;
599-
}
600-
601-
memcpy(out, vsnd_props[id].buf, output_buf_sz);
602-
#endif
603588
vsnd_stream_sel_t *v_ptr = (vsnd_stream_sel_t *) dev->opaque;
604589

605590
pthread_mutex_lock(&virtio_snd_ctrl_mutex);
@@ -616,6 +601,18 @@ static void virtio_snd_cb(struct CNFADriver *dev,
616601

617602
fprintf(stderr, "start to play\n");
618603
int channels = dev->channelsPlay;
604+
#if 0
605+
/* TODO: apply lock on guest_playing */
606+
uint32_t id = v_ptr->stream_id;
607+
int output_buf_sz = framesp * channels;
608+
609+
if (!(playing)) {
610+
memset(out, 0, sizeof(short) * output_buf_sz);
611+
return;
612+
}
613+
614+
memcpy(out, vsnd_props[id].buf, output_buf_sz);
615+
#endif
619616
for (int i = 0; i < framesp; i++) {
620617
// Shift phase, so we run at 440 Hz (A4)
621618
omega += (3.14159 * 2 * 440.) / dev->spsPlay;

0 commit comments

Comments
 (0)