- Timestamp:
- Nov 28, 2016, 6:44:44 PM (8 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, sampler, yinfft+
- Children:
- cad7e91
- Parents:
- b81a642
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/source_avcodec.c
rb81a642 r2f89ef4 61 61 AVFrame *avFrame; 62 62 AVAudioResampleContext *avr; 63 float *output;63 smpl_t *output; 64 64 uint_t read_samples; 65 65 uint_t read_index; … … 206 206 207 207 /* allocate output for avr */ 208 s->output = ( float *)av_malloc(AUBIO_AVCODEC_MAX_BUFFER_SIZE * sizeof(float));208 s->output = (smpl_t *)av_malloc(AUBIO_AVCODEC_MAX_BUFFER_SIZE * sizeof(smpl_t)); 209 209 210 210 s->read_samples = 0; … … 233 233 234 234 void aubio_source_avcodec_reset_resampler(aubio_source_avcodec_t * s, uint_t multi) { 235 // create or reset resampler to/from mono/multi-channel 235 236 if ( (multi != s->multi) || (s->avr == NULL) ) { 236 237 int64_t input_layout = av_get_default_channel_layout(s->input_channels); … … 250 251 av_opt_set_int(avr, "out_sample_rate", s->samplerate, 0); 251 252 av_opt_set_int(avr, "in_sample_fmt", s->avCodecCtx->sample_fmt, 0); 253 #if HAVE_AUBIO_DOUBLE 254 av_opt_set_int(avr, "out_sample_fmt", AV_SAMPLE_FMT_DBL, 0); 255 #else 252 256 av_opt_set_int(avr, "out_sample_fmt", AV_SAMPLE_FMT_FLT, 0); 257 #endif 258 // TODO: use planar? 259 //av_opt_set_int(avr, "out_sample_fmt", AV_SAMPLE_FMT_FLTP, 0); 253 260 int err; 254 261 if ( ( err = avresample_open(avr) ) < 0) {
Note: See TracChangeset
for help on using the changeset viewer.