Changeset 4522:c335603c6371 in roaraudio for libroar/buffer.c
- Timestamp:
- 10/16/10 17:33:36 (14 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/buffer.c
r4516 r4522 93 93 } 94 94 95 new->refc = 1; 96 95 97 new->data = data; 96 98 … … 110 112 } 111 113 112 int roar_buffer_free (struct roar_buffer * buf) { 114 int roar_buffer_ref (struct roar_buffer * buf) { 115 if ( buf == NULL ) 116 return -1; 117 118 buf->refc++; 119 120 return 0; 121 } 122 123 int roar_buffer_unref (struct roar_buffer * buf) { 113 124 struct roar_buffer * next; 114 125 115 126 if ( buf == NULL ) 116 127 return -1; 128 129 if ( buf->refc == 0 ) { 130 ROAR_WARN("roar_buffer_unref(buf=%p): Ref counter is wrong. assuming one."); 131 buf->refc = 1; 132 } 133 134 buf->refc--; 135 136 if ( buf->refc ) 137 return 0; 117 138 118 139 while ((next = buf->next)) {
Note: See TracChangeset
for help on using the changeset viewer.