diff mbox

[16/16] ALSA: line6: Skip volume manipulation during silence copying

Message ID 1422033203-23254-17-git-send-email-tiwai@suse.de (mailing list archive)
State Accepted
Commit 62a109d9e2ce948ee75222bbb92a97669f683875
Headers show

Commit Message

Takashi Iwai Jan. 23, 2015, 5:13 p.m. UTC
A minor optimization; while pausing, the driver just copies the zero
that doesn't need any volume changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/usb/line6/playback.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/sound/usb/line6/playback.c b/sound/usb/line6/playback.c
index cbcd97f5d629..3762a98026aa 100644
--- a/sound/usb/line6/playback.c
+++ b/sound/usb/line6/playback.c
@@ -234,13 +234,14 @@  static int submit_audio_out_urb(struct snd_line6_pcm *line6pcm)
 		line6pcm->out.pos += urb_frames;
 		if (line6pcm->out.pos >= runtime->buffer_size)
 			line6pcm->out.pos -= runtime->buffer_size;
+
+		change_volume(urb_out, line6pcm->volume_playback,
+			      bytes_per_frame);
 	} else {
 		memset(urb_out->transfer_buffer, 0,
 		       urb_out->transfer_buffer_length);
 	}
 
-	change_volume(urb_out, line6pcm->volume_playback, bytes_per_frame);
-
 	if (line6pcm->prev_fbuf != NULL) {
 		if (line6pcm->flags & LINE6_BITS_PCM_IMPULSE) {
 			create_impulse_test_signal(line6pcm, urb_out,