]> git.alsa-project.org Git - alsa-plugins.git/commitdiff
jack: Allow build with older alsa-lib
authorTakashi Iwai <tiwai@suse.de>
Tue, 3 Jul 2018 15:13:00 +0000 (17:13 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 3 Jul 2018 15:16:08 +0000 (17:16 +0200)
The new API snd_pcm_ioplug_avail() doesn't appear prior to alsa-lib
1.1.7.  Add an own code for allowing the build with alsa-lib 1.1.6.

It has a very slight overhead than the original snd_pcm_ioplug_avail()
but should be OK as a workaround.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
jack/pcm_jack.c

index 98a6f7ebb82e9014461016a14568ade9d72d33af..fbc9dafc594b18e7376143b4f4f630ff0204bbb0 100644 (file)
@@ -58,6 +58,15 @@ typedef struct {
 
 static int snd_pcm_jack_stop(snd_pcm_ioplug_t *io);
 
+/* snd_pcm_ioplug_avail() was introduced after alsa-lib 1.1.6 */
+#if SND_LIB_VERSION < 0x10107
+static snd_pcm_uframes_t snd_pcm_ioplug_avail(const snd_pcm_ioplug_t *io,
+                                             const snd_pcm_uframes_t hw_ptr,
+                                             const snd_pcm_uframes_t appl_ptr)
+{
+       return io->buffer_size - snd_pcm_ioplug_hw_avail(io, hw_ptr, appl_ptr);
+}
+#endif
 
 static int pcm_poll_block_check(snd_pcm_ioplug_t *io)
 {