diff options
author | Takashi Iwai <tiwai@suse.de> | 2018-01-15 16:48:36 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-01-15 16:48:36 +0100 |
commit | 671ec859e5ee06ab0bf968e639a25576b18865ad (patch) | |
tree | 43385603e1e54f05587ec7f6fe0eb63bba9498a9 /sound/core/seq/seq_queue.c | |
parent | 4ea5553a51e55664f86bed29e62e67ecb45bedd8 (diff) | |
download | blackbird-op-linux-671ec859e5ee06ab0bf968e639a25576b18865ad.tar.gz blackbird-op-linux-671ec859e5ee06ab0bf968e639a25576b18865ad.zip |
ALSA: seq: Process queue tempo/ppq change in a shot
The SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO ioctl sets the tempo and the ppq
in a single call, while the current implementation updates each value
one by one. This is a bit racy, and also suboptimal from the
performance POV, as each call does re-acquire the lock and invokes
the update of ALSA timer resolution.
This patch reorganizes the code slightly so that we change both the
tempo and the ppq in a shot. The skew value can be put into the same
lock, but this is rather a rarely used feature and completely
independent from the temp/ppq (it's evaluated only in the interrupt),
so it's left as it was.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/seq/seq_queue.c')
-rw-r--r-- | sound/core/seq/seq_queue.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/core/seq/seq_queue.c b/sound/core/seq/seq_queue.c index 79e0c5604ef8..0428e9061b47 100644 --- a/sound/core/seq/seq_queue.c +++ b/sound/core/seq/seq_queue.c @@ -497,9 +497,7 @@ int snd_seq_queue_timer_set_tempo(int queueid, int client, return -EPERM; } - result = snd_seq_timer_set_tempo(q->timer, info->tempo); - if (result >= 0) - result = snd_seq_timer_set_ppq(q->timer, info->ppq); + result = snd_seq_timer_set_tempo_ppq(q->timer, info->tempo, info->ppq); if (result >= 0 && info->skew_base > 0) result = snd_seq_timer_set_skew(q->timer, info->skew_value, info->skew_base); |