Changeset 2311:883f5e3c33f0 in roaraudio


Ignore:
Timestamp:
08/05/09 16:29:04 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added a lot debug lions, commented out parts making the speex xcoder unusable

Location:
libroardsp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libroardsp/transcode.c

    r2297 r2311  
    129129 _CHECK(); 
    130130 
     131 ROAR_DBG("roar_xcoder_proc_packet(state=%p, buf=%p, len=%lu) = ?", state, buf, (unsigned long)len); 
     132 
    131133 if ( state->backend == NULL ) 
    132134  return -1; 
     
    168170 int ret; 
    169171 
     172 ROAR_DBG("roar_bixcoder_packet_size(state=%p, samples=%i) = ?", state, samples); 
     173 
    170174 if ( state == NULL ) 
    171175  return -1; 
     
    174178  return -1; 
    175179 
     180 ROAR_DBG("roar_bixcoder_packet_size(state=%p, samples=%i): ret=%i", state, samples, ret); 
     181 
     182// TODO: we need a lot hope here... 
     183/* 
    176184 if ( roar_xcoder_packet_size(&(state->decoder), ret) != ret ) 
    177185  return -1; 
    178  
     186*/ 
     187 
     188 ROAR_DBG("roar_bixcoder_packet_size(state=%p, samples=%i) = %i", state, samples, ret); 
    179189 return ret; 
    180190} 
     
    195205 
    196206int roar_bixcoder_read_packet (struct roar_bixcoder * state, void * buf, size_t len) { 
     207 
     208 ROAR_DBG("roar_bixcoder_read_packet(state=%p, buf=%p, len=%lu) = ?", state, buf, (unsigned long)len); 
     209 
    197210 if ( state == NULL ) 
    198211  return -1; 
  • libroardsp/transcode_speex.c

    r2305 r2311  
    3434 struct roar_audio_info  * info = &(state->info.pcm); 
    3535 int tmp; 
     36 
     37 ROAR_DBG("roar_xcoder_speex_init(*): sizeof(*self) = %lu", (unsigned long)sizeof(*self)); 
    3638 
    3739 if ( self == NULL ) 
     
    162164 SpeexCallback callback; 
    163165 
     166 ROAR_DBG("roar_xcoder_speex_decode(state=%p, buf=%p, len=%lu) = ?", state, buf, (unsigned long)len); 
     167 
    164168 if ( state->stage == ROAR_XCODER_STAGE_INITED ) { 
     169  ROAR_DBG("roar_xcoder_speex_decode(state=%p, buf=%p, len=%lu): state->stage = INITED", state, buf, (unsigned long)len); 
    165170  if ( roar_vio_read(state->backend, magic, ROAR_SPEEX_MAGIC_LEN) != ROAR_SPEEX_MAGIC_LEN ) 
    166171   return -1; 
     
    170175 
    171176  state->stage = ROAR_XCODER_STAGE_MAGIC; 
     177  ROAR_DBG("roar_xcoder_speex_decode(state=%p, buf=%p, len=%lu): state->stage = MAGIC", state, buf, (unsigned long)len); 
    172178 
    173179  if ( roar_vio_read(state->backend, &tmp_net, 2) != 2 ) 
     
    177183 
    178184  state->stage = ROAR_XCODER_STAGE_OPENING; 
     185  ROAR_DBG("roar_xcoder_speex_decode(state=%p, buf=%p, len=%lu): state->stage = OPENING", state, buf, (unsigned long)len); 
    179186 
    180187  switch (self->mode) { 
     
    187194  } 
    188195 
     196  ROAR_DBG("roar_xcoder_speex_decode(state=%p, buf=%p, len=%lu): opened decoder state", state, buf, (unsigned long)len); 
     197 
    189198  tmp=1; 
    190199  speex_decoder_ctl(self->xcoder, SPEEX_SET_ENH, &tmp); 
     200/* 
     201// FIXME: why does this make the decoder segfaul? 
    191202  tmp = state->info.pcm.rate; 
    192203  speex_encoder_ctl(self->xcoder, SPEEX_SET_SAMPLING_RATE, &tmp); 
     204*/ 
    193205  speex_decoder_ctl(self->xcoder, SPEEX_GET_FRAME_SIZE, &(self->frame_size)); 
     206 
     207  ROAR_DBG("roar_xcoder_speex_decode(state=%p, buf=%p, len=%lu): self->stereo = %i", state, buf, (unsigned long)len, self->stereo); 
    194208 
    195209  if ( self->stereo ) { 
     
    204218 
    205219  state->stage = ROAR_XCODER_STAGE_OPENED; 
    206  } 
     220  ROAR_DBG("roar_xcoder_speex_decode(state=%p, buf=%p, len=%lu): state->stage = OPENED", state, buf, (unsigned long)len); 
     221 } 
     222 
     223 ROAR_DBG("roar_xcoder_speex_decode(state=%p, buf=%p, len=%lu): state->stage = %s", state, buf, (unsigned long)len, 
     224          state->stage == ROAR_XCODER_STAGE_OPENED ? "OPENED" : "???" 
     225         ); 
    207226 
    208227 if ( roar_vio_read(state->backend, &tmp_net, 2) != 2 ) 
     
    213232 if ( pkg_len > ROAR_SPEEX_MAX_CC ) 
    214233  return -1; 
     234 
     235 ROAR_DBG("roar_xcoder_speex_decode(state=%p, buf=%p, len=%lu) = ?", state, buf, (unsigned long)len); 
    215236 
    216237 if ( roar_vio_read(state->backend, self->cc, pkg_len) != pkg_len ) 
     
    225246 } 
    226247 
     248 ROAR_DBG("roar_xcoder_speex_decode(state=%p, buf=%p, len=%lu) = 0", state, buf, (unsigned long)len); 
    227249 return 0; 
    228250} 
Note: See TracChangeset for help on using the changeset viewer.