Changeset 2311:883f5e3c33f0 in roaraudio
- Timestamp:
- 08/05/09 16:29:04 (15 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- libroardsp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libroardsp/transcode.c
r2297 r2311 129 129 _CHECK(); 130 130 131 ROAR_DBG("roar_xcoder_proc_packet(state=%p, buf=%p, len=%lu) = ?", state, buf, (unsigned long)len); 132 131 133 if ( state->backend == NULL ) 132 134 return -1; … … 168 170 int ret; 169 171 172 ROAR_DBG("roar_bixcoder_packet_size(state=%p, samples=%i) = ?", state, samples); 173 170 174 if ( state == NULL ) 171 175 return -1; … … 174 178 return -1; 175 179 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 /* 176 184 if ( roar_xcoder_packet_size(&(state->decoder), ret) != ret ) 177 185 return -1; 178 186 */ 187 188 ROAR_DBG("roar_bixcoder_packet_size(state=%p, samples=%i) = %i", state, samples, ret); 179 189 return ret; 180 190 } … … 195 205 196 206 int 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 197 210 if ( state == NULL ) 198 211 return -1; -
libroardsp/transcode_speex.c
r2305 r2311 34 34 struct roar_audio_info * info = &(state->info.pcm); 35 35 int tmp; 36 37 ROAR_DBG("roar_xcoder_speex_init(*): sizeof(*self) = %lu", (unsigned long)sizeof(*self)); 36 38 37 39 if ( self == NULL ) … … 162 164 SpeexCallback callback; 163 165 166 ROAR_DBG("roar_xcoder_speex_decode(state=%p, buf=%p, len=%lu) = ?", state, buf, (unsigned long)len); 167 164 168 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); 165 170 if ( roar_vio_read(state->backend, magic, ROAR_SPEEX_MAGIC_LEN) != ROAR_SPEEX_MAGIC_LEN ) 166 171 return -1; … … 170 175 171 176 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); 172 178 173 179 if ( roar_vio_read(state->backend, &tmp_net, 2) != 2 ) … … 177 183 178 184 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); 179 186 180 187 switch (self->mode) { … … 187 194 } 188 195 196 ROAR_DBG("roar_xcoder_speex_decode(state=%p, buf=%p, len=%lu): opened decoder state", state, buf, (unsigned long)len); 197 189 198 tmp=1; 190 199 speex_decoder_ctl(self->xcoder, SPEEX_SET_ENH, &tmp); 200 /* 201 // FIXME: why does this make the decoder segfaul? 191 202 tmp = state->info.pcm.rate; 192 203 speex_encoder_ctl(self->xcoder, SPEEX_SET_SAMPLING_RATE, &tmp); 204 */ 193 205 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); 194 208 195 209 if ( self->stereo ) { … … 204 218 205 219 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 ); 207 226 208 227 if ( roar_vio_read(state->backend, &tmp_net, 2) != 2 ) … … 213 232 if ( pkg_len > ROAR_SPEEX_MAX_CC ) 214 233 return -1; 234 235 ROAR_DBG("roar_xcoder_speex_decode(state=%p, buf=%p, len=%lu) = ?", state, buf, (unsigned long)len); 215 236 216 237 if ( roar_vio_read(state->backend, self->cc, pkg_len) != pkg_len ) … … 225 246 } 226 247 248 ROAR_DBG("roar_xcoder_speex_decode(state=%p, buf=%p, len=%lu) = 0", state, buf, (unsigned long)len); 227 249 return 0; 228 250 }
Note: See TracChangeset
for help on using the changeset viewer.