Changeset 5348:83fcc9598253 in roaraudio for libroarpulse


Ignore:
Timestamp:
12/11/11 12:38:30 (8 years ago)
Author:
phi
Branch:
default
Message:

Converted roar_buffer API to fully use refcounter (Closes: #126)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroarpulse/stream.c

    r5300 r5348  
    235235   break; 
    236236  case PA_STREAM_RECORD: 
    237     if ( roar_buffer_new(&buf, s->fragments.size) == -1 ) 
     237    if ( roar_buffer_new_data(&buf, s->fragments.size, &data) == -1 ) 
    238238     return; 
    239  
    240     if ( roar_buffer_get_data(buf, &data) == -1 ) { 
    241      roar_buffer_free(buf); 
    242      return; 
    243     } 
    244239 
    245240    if ( (ret = roar_vio_read(&(s->vio), data, s->fragments.size)) < 1 ) { 
     
    442437 // seems we have a valid write from here. 
    443438 
    444  if ( roar_buffer_new(&buf, length) == -1 ) { 
    445   if ( free_cb != NULL ) 
    446    free_cb((void*)data); 
    447  
    448   return -1; 
    449  } 
    450  
    451  if ( roar_buffer_get_data(buf, &bufdata) == -1 ) { 
     439 if ( roar_buffer_new_data(&buf, length, &bufdata) == -1 ) { 
    452440  if ( free_cb != NULL ) 
    453441   free_cb((void*)data); 
     
    463451  p->iobuffer = buf; 
    464452 } else { 
    465   if ( roar_buffer_moveinto(p->iobuffer, &buf) == -1 ) 
     453  if ( roar_buffer_moveinto(p->iobuffer, &buf) == -1 ) { 
     454   roar_buffer_free(buf); 
    466455   return -1; 
     456  } 
    467457 } 
    468458 
Note: See TracChangeset for help on using the changeset viewer.