s->resample_context= av_resample_init(output_rate, input_rate,
filter_length, log2_phase_count, linear, cutoff);
- *(AVClass**)s->resample_context = &audioresample_context_class;
+ *(const AVClass**)s->resample_context = &audioresample_context_class;
return s;
}
s->buffer_size[0] = input_size;
s->buffer[0] = av_malloc(s->buffer_size[0]);
if (!s->buffer[0]) {
- av_log(s, AV_LOG_ERROR, "Could not allocate buffer\n");
+ av_log(s->resample_context, AV_LOG_ERROR, "Could not allocate buffer\n");
return 0;
}
}
if (av_audio_convert(s->convert_ctx[0], obuf, ostride,
ibuf, istride, nb_samples*s->input_channels) < 0) {
- av_log(s, AV_LOG_ERROR, "Audio sample format conversion failed\n");
+ av_log(s->resample_context, AV_LOG_ERROR, "Audio sample format conversion failed\n");
return 0;
}
s->buffer_size[1] = lenout;
s->buffer[1] = av_malloc(s->buffer_size[1]);
if (!s->buffer[1]) {
- av_log(s, AV_LOG_ERROR, "Could not allocate buffer\n");
+ av_log(s->resample_context, AV_LOG_ERROR, "Could not allocate buffer\n");
return 0;
}
}
if (av_audio_convert(s->convert_ctx[1], obuf, ostride,
ibuf, istride, nb_samples1*s->output_channels) < 0) {
- av_log(s, AV_LOG_ERROR, "Audio sample format convertion failed\n");
+ av_log(s->resample_context, AV_LOG_ERROR, "Audio sample format convertion failed\n");
return 0;
}
}