Changeset 5301:f3e9cd30574d in roaraudio


Ignore:
Timestamp:
11/25/11 18:20:03 (8 years ago)
Author:
phi
Branch:
default
Message:

move away from roar_buffer_add() (See: #126)

Files:
12 edited

Legend:

Unmodified
Added
Removed
  • plugins/roard/protocol-gopher.c

    r5242 r5301  
    691691  } 
    692692 
    693   clients_add_output(client, buf); 
     693  clients_add_output(client, &buf); 
    694694 } 
    695695 
     
    711711 //memcpy(data+len, "\r\n.\r\n\0", 6); 
    712712 memcpy(data+len, "\0", 1); 
    713  clients_add_output(client, buf); 
     713 clients_add_output(client, &buf); 
    714714 
    715715 return 0; 
  • roard/clients.c

    r5295 r5301  
    798798} 
    799799 
    800 int clients_add_output (int id, struct roar_buffer * buf) { 
     800int clients_add_output (int id, struct roar_buffer ** buf) { 
    801801 struct roar_client_server   * cs; 
    802802 
     
    805805 
    806806 if ( cs->outbuf == NULL ) { 
    807   cs->outbuf = buf; 
     807  cs->outbuf = *buf; 
    808808 } else { 
    809   return roar_buffer_add(cs->outbuf, buf); 
     809  return roar_buffer_moveinto(cs->outbuf, buf); 
    810810 } 
    811811 
  • roard/codecfilter_fishsound.c

    r5242 r5301  
    8484  self->buffer = buf; 
    8585 } else { 
    86   if ( roar_buffer_add(self->buffer, buf) == -1 ) { 
     86  if ( roar_buffer_moveinto(self->buffer, &buf) == -1 ) { 
    8787   roar_buffer_free(buf); 
    8888   return -1; 
  • roard/codecfilter_flac.c

    r5242 r5301  
    101101  self->decoder.written = buf; 
    102102 } else { 
    103   if ( roar_buffer_add(self->decoder.written, buf) == -1 ) { 
     103  if ( roar_buffer_moveinto(self->decoder.written, &buf) == -1 ) { 
    104104   roar_buffer_free(buf); 
    105105   return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; 
  • roard/include/client.h

    r5275 r5301  
    113113int clients_send_filter(struct roar_audio_info * sa, uint32_t pos); 
    114114 
    115 int clients_add_output (int id, struct roar_buffer * buf); 
     115int clients_add_output (int id, struct roar_buffer ** buf); 
    116116 
    117117// proto support 
  • roard/include/streams.h

    r5288 r5301  
    187187int streams_ctl          (int id, int_least32_t cmd, void * data); 
    188188 
    189 int stream_add_buffer     (int id, struct roar_buffer *  buf); 
     189int stream_add_buffer     (int id, struct roar_buffer **  buf); 
    190190//int stream_get_buffer     (int id, struct roar_buffer ** buf); 
    191191int stream_shift_out_buffer   (int id, void * data, size_t * len); 
     
    196196int stream_outputbuffer_destroy(int id); 
    197197 
    198 int stream_prethru_add(int id, struct roar_buffer * buf); 
     198int stream_prethru_add(int id, struct roar_buffer ** buf); 
    199199int stream_prethru_add_data(int id, void ** buf, size_t len); 
    200200int stream_prethru_destroy(int id); 
  • roard/midi.c

    r5278 r5301  
    186186 } 
    187187 
    188  if ( stream_add_buffer(id, b) == -1 ) { 
     188 if ( stream_add_buffer(id, &b) == -1 ) { 
    189189  roar_buffer_free(b); 
    190190  streams_delete(id); 
     
    714714  g_midi_mess.buf = buf; 
    715715 } else { 
    716   if ( roar_buffer_add(g_midi_mess.buf, buf) == -1 ) { 
     716  if ( roar_buffer_moveinto(g_midi_mess.buf, &buf) == -1 ) { 
    717717   ROAR_DBG("midi_add_buf(*) = -1"); 
    718718   return -1; 
  • roard/req.c

    r5295 r5301  
    17621762 } 
    17631763 
    1764  if ( stream_add_buffer(mes->stream, b) == -1 ) { 
     1764 if ( stream_add_buffer(mes->stream, &b) == -1 ) { 
    17651765  roar_buffer_free(b); 
    17661766  return -1; 
  • roard/sample.c

    r5192 r5301  
    114114  c->data = new; 
    115115 } else { 
    116   if ( roar_buffer_add(c->data, new) == -1 ) { 
     116  if ( roar_buffer_moveinto(c->data, &new) == -1 ) { 
    117117   save_err = roar_error; 
    118118   roar_buffer_free(new); 
  • roard/ssynth.c

    r5194 r5301  
    181181  } 
    182182 
    183   if ( stream_add_buffer(g_ssynth.stream, outbuf) == -1 ) { 
     183  if ( stream_add_buffer(g_ssynth.stream, &outbuf) == -1 ) { 
    184184   roar_buffer_free(outbuf); 
    185185   return -1; 
  • roard/streams.c

    r5288 r5301  
    19451945 
    19461946 
    1947 int stream_add_buffer  (int id, struct roar_buffer * buf) { 
     1947int stream_add_buffer  (int id, struct roar_buffer ** buf) { 
    19481948 ROAR_DBG("stream_add_buffer(id=%i, buf=%p) = ?", id, buf); 
    19491949 
     
    19511951 
    19521952 if ( g_streams[id]->buffer == NULL ) { 
    1953   g_streams[id]->buffer = buf; 
     1953  g_streams[id]->buffer = *buf; 
     1954  *buf = NULL; 
    19541955  ROAR_DBG("stream_add_buffer(id=%i, buf=%p) = 0", id, buf); 
    19551956  return 0; 
     
    19571958 
    19581959 ROAR_DBG("stream_add_buffer(id=%i, buf=%p) = ?", id, buf); 
    1959  return roar_buffer_add(g_streams[id]->buffer, buf); 
     1960 return roar_buffer_moveinto(g_streams[id]->buffer, buf); 
    19601961} 
    19611962 
     
    20412042} 
    20422043 
    2043 int stream_prethru_add(int id, struct roar_buffer * buf) { 
     2044int stream_prethru_add(int id, struct roar_buffer ** buf) { 
    20442045 register struct roar_stream_server *  ss; 
    20452046 
     
    20502051 
    20512052 if ( ss->prethru == NULL ) { 
    2052   ss->prethru = buf; 
     2053  ss->prethru = *buf; 
     2054  *buf = NULL; 
    20532055  return 0; 
    20542056 } 
    20552057 
    2056  if ( roar_buffer_add(ss->prethru, buf) == -1 ) { 
     2058 if ( roar_buffer_moveinto(ss->prethru, buf) == -1 ) { 
    20572059  return -1; 
    20582060 } 
     
    20662068 _CHECK_SID(id); 
    20672069 
    2068  if ( roar_buffer_new(&buffer, len) == -1 ) 
    2069   return -1; 
    2070  
    2071  if ( roar_buffer_get_data(buffer, buf) == -1 ) { 
    2072   roar_buffer_free(buffer); 
    2073   return -1; 
    2074  } 
    2075  
    2076  if ( stream_prethru_add(id, buffer) == -1 ) { 
     2070 if ( roar_buffer_new_data(&buffer, len, buf) == -1 ) 
     2071  return -1; 
     2072 
     2073 if ( stream_prethru_add(id, &buffer) == -1 ) { 
    20772074  roar_buffer_free(buffer); 
    20782075  return -1; 
     
    22632260 
    22642261  if ( roar_buffer_set_len(b, req) != -1 ) { 
    2265    if ( stream_add_buffer(id, b) != -1 ) 
     2262   if ( stream_add_buffer(id, &b) != -1 ) 
    22662263    return 0; 
    22672264 
  • roard/waveform.c

    r5194 r5301  
    133133  } 
    134134 
    135   if ( stream_add_buffer(g_waveform_recbridge.stream, buf) == -1 ) { 
     135  if ( stream_add_buffer(g_waveform_recbridge.stream, &buf) == -1 ) { 
    136136   ROAR_ERR("waveform_update_inputs(void): Can not attach a new buffer object to the Record Bridge. Bad."); 
    137137   roar_buffer_free(buf); 
Note: See TracChangeset for help on using the changeset viewer.