[xiph-commits] r12338 - trunk/oss2pulse/src/oss2pulse

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Wed Jan 17 06:06:35 PST 2007


Author: xiphmont
Date: 2007-01-17 06:06:32 -0800 (Wed, 17 Jan 2007)
New Revision: 12338

Removed:
   trunk/oss2pulse/src/oss2pulse/llist.h
Modified:
   trunk/oss2pulse/src/oss2pulse/common.c
   trunk/oss2pulse/src/oss2pulse/dsp.c
   trunk/oss2pulse/src/oss2pulse/mixer.c
   trunk/oss2pulse/src/oss2pulse/oss2pulse.h
Log:
Remove pa_llist usage that was carried over from padsp, but it useless in oss2pulse.



Modified: trunk/oss2pulse/src/oss2pulse/common.c
===================================================================
--- trunk/oss2pulse/src/oss2pulse/common.c	2007-01-17 13:52:06 UTC (rev 12337)
+++ trunk/oss2pulse/src/oss2pulse/common.c	2007-01-17 14:06:32 UTC (rev 12338)
@@ -50,7 +50,7 @@
     free(i);
 }
 
-static fd_info *fd_info_ref(fd_info *i) {
+fd_info *fd_info_ref(fd_info *i) {
     assert(i);
     
     pthread_mutex_lock(&i->mutex);
@@ -131,7 +131,6 @@
     i->volume_modify_count = 0;
     i->sink_index = (uint32_t) -1;
     i->source_index = (uint32_t) -1;
-    PA_LLIST_INIT(fd_info, i);
 
     reset_params(i);
 
@@ -186,27 +185,3 @@
     
     return NULL;
 }
-
-static pthread_mutex_t fd_infos_mutex = PTHREAD_MUTEX_INITIALIZER;
-static PA_LLIST_HEAD(fd_info, fd_infos) = NULL;
-
-void fd_info_add_to_list(fd_info *i) {
-    assert(i);
-
-    pthread_mutex_lock(&fd_infos_mutex);
-    PA_LLIST_PREPEND(fd_info, fd_infos, i);
-    pthread_mutex_unlock(&fd_infos_mutex);
-
-    fd_info_ref(i);
-}
-
-void fd_info_remove_from_list(fd_info *i) {
-    assert(i);
-
-    pthread_mutex_lock(&fd_infos_mutex);
-    PA_LLIST_REMOVE(fd_info, fd_infos, i);
-    pthread_mutex_unlock(&fd_infos_mutex);
-
-    fd_info_unref(i);
-}
-

Modified: trunk/oss2pulse/src/oss2pulse/dsp.c
===================================================================
--- trunk/oss2pulse/src/oss2pulse/dsp.c	2007-01-17 13:52:06 UTC (rev 12337)
+++ trunk/oss2pulse/src/oss2pulse/dsp.c	2007-01-17 14:06:32 UTC (rev 12338)
@@ -595,11 +595,7 @@
   debug(DEBUG_LEVEL_NORMAL, __FILE__": dsp_open_worker()\n");
   
   if ((i = fd_info_new(FD_INFO_STREAM, &ret))){
-
     debug(DEBUG_LEVEL_NORMAL, __FILE__": dsp_open() succeeded\n");
-    
-    fd_info_add_to_list(i);
-    fd_info_unref(i);
     file->private_data = i;
   }
 
@@ -1025,7 +1021,7 @@
     int ret = 0;
     close_helper(i,0);  
     if(dsp_drain(i)) ret = -EIO; 
-    fd_info_remove_from_list(i);
+    fd_info_unref(i);
     fusd_return(file, ret);
   }
   return 0;

Deleted: trunk/oss2pulse/src/oss2pulse/llist.h
===================================================================
--- trunk/oss2pulse/src/oss2pulse/llist.h	2007-01-17 13:52:06 UTC (rev 12337)
+++ trunk/oss2pulse/src/oss2pulse/llist.h	2007-01-17 14:06:32 UTC (rev 12338)
@@ -1,98 +0,0 @@
-#ifndef foollistfoo
-#define foollistfoo
-
-/* $Id: llist.h 1258 2006-08-17 20:01:04Z lennart $ */
-
-/***
-  This file is part of PulseAudio.
- 
-  PulseAudio is free software; you can redistribute it and/or modify
-  it under the terms of the GNU Lesser General Public License as
-  published by the Free Software Foundation; either version 2 of the
-  License, or (at your option) any later version.
- 
-  PulseAudio is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  General Public License for more details.
- 
-  You should have received a copy of the GNU Lesser General Public
-  License along with PulseAudio; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-  USA.
-***/
-
-#include <assert.h>
-
-/* Some macros for maintaining doubly linked lists */
-
-/* The head of the linked list. Use this in the structure that shall
- * contain the head of the linked list */
-#define PA_LLIST_HEAD(t,name) t *name
-
-/* The pointers in the linked list's items. Use this in the item structure */
-#define PA_LLIST_FIELDS(t) t *next, *prev
-
-/* Initialize the list's head */
-#define PA_LLIST_HEAD_INIT(t,item) do { (item) = (t*) NULL; } while(0)
-
-/* Initialize a list item */
-#define PA_LLIST_INIT(t,item) do { \
-                               t *_item = (item); \
-                               assert(_item); \
-                               _item->prev = _item->next = NULL; \
-                               } while(0)
-
-/* Prepend an item to the list */
-#define PA_LLIST_PREPEND(t,head,item) do { \
-                                        t **_head = &(head), *_item = (item); \
-                                        assert(_item); \
-                                        if ((_item->next = *_head)) \
-                                           _item->next->prev = _item; \
-                                        _item->prev = NULL; \
-                                        *_head = _item; \
-                                        } while (0)
-
-/* Remove an item from the list */
-#define PA_LLIST_REMOVE(t,head,item) do { \
-                                    t **_head = &(head), *_item = (item); \
-                                    assert(_item); \
-                                    if (_item->next) \
-                                       _item->next->prev = _item->prev; \
-                                    if (_item->prev) \
-                                       _item->prev->next = _item->next; \
-                                    else {\
-                                       assert(*_head == _item); \
-                                       *_head = _item->next; \
-                                    } \
-                                    _item->next = _item->prev = NULL; \
-                                    } while(0)
-
-#define PA_LLIST_FIND_HEAD(t,item,head) \
-do { \
-    t **_head = (head), *_item = (item); \
-    *_head = _item; \
-    assert(_head); \
-    while ((*_head)->prev) \
-        *_head = (*_head)->prev; \
-} while (0) 
-
-#define PA_LLIST_INSERT_AFTER(t,head,a,b) \
-do { \
-    t **_head = &(head), *_a = (a), *_b = (b); \
-    assert(_b); \
-    if (!_a) { \
-        if ((_b->next = *_head)) \
-            _b->next->prev = _b; \
-        _b->prev = NULL; \
-        *_head = _b; \
-    } else { \
-        if ((_b->next = _a->next)) \
-            _b->next->prev = _b; \
-        _b->prev = _a; \
-        _a->next = _b; \
-    } \
-} while (0) 
-    
-
-#endif

Modified: trunk/oss2pulse/src/oss2pulse/mixer.c
===================================================================
--- trunk/oss2pulse/src/oss2pulse/mixer.c	2007-01-17 13:52:06 UTC (rev 12337)
+++ trunk/oss2pulse/src/oss2pulse/mixer.c	2007-01-17 14:06:32 UTC (rev 12338)
@@ -156,9 +156,6 @@
     file->private_data = i;
     
     pa_threaded_mainloop_unlock(i->mainloop);
-    
-    fd_info_add_to_list(i);
-    fd_info_unref(i);
   }
 
   fusd_return(file, 0);
@@ -406,7 +403,7 @@
   
   debug(DEBUG_LEVEL_NORMAL, __FILE__": close()\n");
   
-  fd_info_remove_from_list(i);
+  fd_info_unref(i);
   
   return 0;
 }

Modified: trunk/oss2pulse/src/oss2pulse/oss2pulse.h
===================================================================
--- trunk/oss2pulse/src/oss2pulse/oss2pulse.h	2007-01-17 13:52:06 UTC (rev 12337)
+++ trunk/oss2pulse/src/oss2pulse/oss2pulse.h	2007-01-17 14:06:32 UTC (rev 12338)
@@ -43,7 +43,6 @@
 #include <fusd.h>
 
 #include <pulse/pulseaudio.h>
-#include "llist.h"
 
 // Define the DEBUG_LEVEL values used for printfs
 #define DEBUG_LEVEL_CRITICAL 0
@@ -113,7 +112,6 @@
   uint32_t sink_index, source_index;
   int volume_modify_count;
   
-  PA_LLIST_FIELDS(fd_info);
 };
 
 #define CONTEXT_CHECK_DEAD_GOTO(i, label) do { \
@@ -144,11 +142,9 @@
 extern struct fusd_file_operations mixer_file_ops;
 
 extern fd_info* fd_info_new(fd_info_type_t type, int *_errno);
+extern fd_info *fd_info_ref(fd_info *i);
 extern void fd_info_unref(fd_info *i);
 extern void reset_params(fd_info *i);
 
-extern void fd_info_remove_from_list(fd_info *i);
-extern void fd_info_add_to_list(fd_info *i);
-
 extern void debug(const int level, const char *format, ...);
 



More information about the commits mailing list