Changeset 5299:5fbc169961b9 in roaraudio for libroar
- Timestamp:
- 11/25/11 09:24:14 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/buffer.c
r5298 r5299 95 95 if ( buf->refc == 0 ) { 96 96 roar_panic(ROAR_FATAL_ERROR_MEMORY_CORRUPTION, NULL); 97 roar_err_set(ROAR_ERROR_FAULT); 98 return -1; 97 99 } 98 100 … … 264 266 265 267 int roar_buffer_add (struct roar_buffer * buf, struct roar_buffer * next) { 266 return roar_buffer_moveinto(buf, next);267 } 268 269 int roar_buffer_moveinto (struct roar_buffer * buf, struct roar_buffer * 268 return roar_buffer_moveinto(buf, &next); 269 } 270 271 int roar_buffer_moveinto (struct roar_buffer * buf, struct roar_buffer ** next) { 270 272 unsigned int deep = 0; 271 273 272 _ckbuf( 0)274 _ckbuf(next == NULL || _ckmem_corruption(*next, 0)) 273 275 274 276 ROAR_DBG("buffer_add(buf=%p, next=%p) = ?", buf, next); 277 ROAR_DBG("buffer_add(buf=%p, next=%p): *next=%p", buf, next, *next); 275 278 276 279 if ( buf->flags & ROAR_BUFFER_FLAG_RING ) { … … 279 282 } 280 283 281 if ( buf == next ) {284 if ( buf == *next ) { 282 285 ROAR_ERR("buffer_add(*): both pointer are of the same destination, This is a error in the application"); 283 286 roar_err_set(ROAR_ERROR_INVAL); … … 291 294 deep++; 292 295 293 if ( buf == next ) {296 if ( buf == *next ) { 294 297 ROAR_ERR("buffer_add(*): Can not add buffer: loop detected at deep %u. This is a error in the application", deep); 295 298 // why don't we return here? … … 297 300 } 298 301 299 buf->next = next;302 buf->next = *next; 300 303 301 304 ROAR_DBG("buffer_add(*): adding buffer at deep %u", deep); 305 306 *next = NULL; 302 307 303 308 return 0;
Note: See TracChangeset
for help on using the changeset viewer.