rpms/tcl-snack/F-9 snack2.2.10-newALSA.patch, NONE, 1.1 tcl-snack.spec, 1.3, 1.4

Tom Callaway spot at fedoraproject.org
Mon Sep 22 18:38:00 UTC 2008


Author: spot

Update of /cvs/pkgs/rpms/tcl-snack/F-9
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv15973/F-9

Modified Files:
	tcl-snack.spec 
Added Files:
	snack2.2.10-newALSA.patch 
Log Message:
fix snack to work with new alsa

snack2.2.10-newALSA.patch:

--- NEW FILE snack2.2.10-newALSA.patch ---
diff -up snack2.2.10/unix/jkAudIO_alsa.c.newALSA snack2.2.10/unix/jkAudIO_alsa.c
--- snack2.2.10/unix/jkAudIO_alsa.c.newALSA	2008-09-22 14:19:55.000000000 -0400
+++ snack2.2.10/unix/jkAudIO_alsa.c	2008-09-22 14:21:44.000000000 -0400
@@ -49,6 +49,8 @@ static int littleEndian = 0;
 
 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 @@ SnackAudioOpen(ADesc *A, Tcl_Interp *int
     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 @@ SnackAudioPost(ADesc *A)
   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 @@ SnackAudioWriteable(ADesc *A)
 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);
 }
 
 void


Index: tcl-snack.spec
===================================================================
RCS file: /cvs/pkgs/rpms/tcl-snack/F-9/tcl-snack.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- tcl-snack.spec	18 Sep 2008 15:31:09 -0000	1.3
+++ tcl-snack.spec	22 Sep 2008 18:37:30 -0000	1.4
@@ -9,7 +9,7 @@
 
 Name:		tcl-%{realname}
 Version:	2.2.10
-Release:	4%{?dist}
+Release:	5%{?dist}
 Summary:	Sound toolkit
 Group:		System Environment/Libraries
 License:	GPLv2+
@@ -24,6 +24,7 @@
 Patch0:		snack2.2.10-nomp3.patch
 Patch1:		snack2.2.10-extracflags.patch
 Patch2:		snack2.2.10-shared-stubs.patch
+Patch3:		snack2.2.10-newALSA.patch
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:	tcl-devel, tk-devel, alsa-lib-devel, libogg-devel, libvorbis-devel
 BuildRequires:	python-devel
@@ -59,6 +60,7 @@
 %patch0 -p1 -b .nomp3
 %patch1 -p1 -b .extracflags
 %patch2 -p1 -b .shared-stubs
+%patch3 -p1 -b .newALSA
 chmod -x generic/*.c generic/*.h unix/*.c COPYING README demos/python/*
 iconv -f iso-8859-1 -t utf-8 -o README{.utf8,}
 mv README{.utf8,}
@@ -101,6 +103,9 @@
 %{python_sitelib}/tkSnack*
 
 %changelog
+* Mon Sep 22 2008 Tom "spot" Callaway <tcallawa at redhat.com> 2.2.10-5
+- fix to work with new alsa (from Jeremiah at Myah OS)
+
 * Thu Sep 18 2008 Tom "spot" Callaway <tcallawa at redhat.com> 2.2.10-4
 - *sigh* hardcoding the tcl version is the only way to get it through the buildsystem
 




More information about the fedora-extras-commits mailing list