summaryrefslogtreecommitdiff
path: root/development/snack/02-alsarelated.patch
diff options
context:
space:
mode:
authorZbigniew Baniewski <zb@ispid.com.pl>2011-01-09 00:26:17 -0200
committerRobby Workman <rworkman@slackbuilds.org>2011-01-10 15:04:24 -0600
commit0d456ff51444fb9497e76bec89b5856b6fc5aa1b (patch)
tree8c4ae8fed1a207dbc3cdc90ad1577af74773c28e /development/snack/02-alsarelated.patch
parent3ef093ad9540d9c317b4795ec72642cda11cde56 (diff)
downloadslackbuilds-0d456ff51444fb9497e76bec89b5856b6fc5aa1b.tar.gz
development/snack: Added (sound extensions for TCL)
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'development/snack/02-alsarelated.patch')
-rw-r--r--development/snack/02-alsarelated.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/development/snack/02-alsarelated.patch b/development/snack/02-alsarelated.patch
new file mode 100644
index 0000000000..4bc5416a9e
--- /dev/null
+++ b/development/snack/02-alsarelated.patch
@@ -0,0 +1,47 @@
+--- unix/jkAudIO_alsa.c 2005-12-14 12:29:38.000000000 +0100
++++ unix/jkAudIO_alsa.c 2008-09-01 22:51:20.000000000 +0200
+@@ -49,6 +49,8 @@
+
+ static int minNumChan = 1;
+
++static snd_pcm_uframes_t hw_bufsize = 0;
++
+ int
+ SnackAudioOpen(ADesc *A, Tcl_Interp *interp, char *device, int mode, int freq,
+ int nchannels, int encoding)
+@@ -135,6 +137,9 @@
+ Tcl_AppendResult(interp, "Failed setting HW params.", NULL);
+ return TCL_ERROR;
+ }
++
++ snd_pcm_hw_params_get_buffer_size (hw_params, &hw_bufsize);
++
+ snd_pcm_hw_params_free(hw_params);
+ snd_pcm_prepare(A->handle);
+ if (A->mode == RECORD) {
+@@ -202,6 +207,8 @@
+ int i;
+ static char buf[64];
+
++ return;
++
+ if (A->debug > 1) Snack_WriteLog(" Enter SnackAudioPost\n");
+
+ for (i = 0; i < 1000; i++) {
+@@ -267,12 +274,14 @@
+ long
+ SnackAudioPlayed(ADesc *A)
+ {
+- long avail = _snd_pcm_mmap_hw_ptr(A->handle);
++ // FIX Here, _snd_pcm_mmap_hw_ptr is deprecated in new alsalib
++ long played = A->nWritten - (hw_bufsize - SnackAudioWriteable(A));
++ // long avail = _snd_pcm_mmap_hw_ptr(A->handle);
+
+- if (avail < 0)
+- avail = 0;
++ if (played < 0)
++ return 0;
+
+- return (avail+A->nPlayed);
++ return (played);
+ }