[maemo-commits] [maemo-commits] r9125 - in projects/haf/trunk/osso-af-utils: debian src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Jan 16 16:31:00 EET 2007
Author: kihamala
Date: 2007-01-16 16:30:59 +0200 (Tue, 16 Jan 2007)
New Revision: 9125

Modified:
   projects/haf/trunk/osso-af-utils/debian/changelog
   projects/haf/trunk/osso-af-utils/src/play-sound.c
Log:
fix to segfault


Modified: projects/haf/trunk/osso-af-utils/debian/changelog
===================================================================
--- projects/haf/trunk/osso-af-utils/debian/changelog	2007-01-16 14:23:36 UTC (rev 9124)
+++ projects/haf/trunk/osso-af-utils/debian/changelog	2007-01-16 14:30:59 UTC (rev 9125)
@@ -1,3 +1,10 @@
+osso-af-utils (1.13-1) unstable; urgency=low
+
+  * UNRELEASED
+  * Fix for segfault from Gabriel Schulhof.
+
+ -- Kimmo Hämäläinen <kimmo.hamalainen at nokia.com>  Tue, 16 Jan 2007 16:30:46 +0200
+
 osso-af-utils (1.12-2) unstable; urgency=low
 
   * Added missing file 'compile'. Still Fixes: NB#47604

Modified: projects/haf/trunk/osso-af-utils/src/play-sound.c
===================================================================
--- projects/haf/trunk/osso-af-utils/src/play-sound.c	2007-01-16 14:23:36 UTC (rev 9124)
+++ projects/haf/trunk/osso-af-utils/src/play-sound.c	2007-01-16 14:30:59 UTC (rev 9125)
@@ -138,52 +138,6 @@
     return 1;
 }
 
-
-static void
-wait_for_esd_server_to_quiesce (int esd_fd)
-{
-    char *buf = NULL ;
-    esd_server_info_t *esd_server_info = NULL ;
-    int monitor_fd = -1, read_return = -1, available_bytes = 1, max_avail = 1 ;
-
-    if (NULL != (esd_server_info = esd_get_server_info (esd_fd)))
-    {
-        if ((monitor_fd = esd_monitor_stream (esd_server_info->format, esd_server_info->rate, NULL, NULL)) > 0)
-        {
-            buf = malloc (available_bytes) ;
-            while (TRUE)
-            {
-                struct timeval tv;
-                int first_time = 1;
-                
-                ioctl (monitor_fd, FIONREAD, &available_bytes) ;
-                if (available_bytes > max_avail)
-                {
-                    buf = realloc (buf, max_avail) ;
-					max_avail = available_bytes ;
-                }
-                read_return = read (monitor_fd, &buf, available_bytes) ;
-                if (read_return < 0)
-                {
-                    break ;
-                }
-                else if (read_return == 0 && !first_time)
-                {
-                    break ;
-                }
-
-                tv.tv_sec = 0;
-                tv.tv_usec = 200000;
-                select (0, NULL, NULL, NULL, &tv); /* avoid tight loop */
-                first_time = 0;
-            }
-            free (buf) ;
-            close (monitor_fd) ;
-        }
-        esd_free_server_info (esd_server_info) ;
-    }
-}
-
 static int 
 play_sound(gchar *sound_filename,
            gchar *data) 
@@ -218,8 +172,6 @@
     esd_play_file_with_pan(sock, data,
 		  sound_filename, pan, pan);
 
-    wait_for_esd_server_to_quiesce (sock) ;
-
     esd_close(sock);
 
     return 0;


More information about the maemo-commits mailing list