switch_buffer_create_dynamic(&buffer, 8192, 65536, 0);
+ if (!buffer) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not allocate buffer for %s\n", data);
+ goto end;
+ }
+
av_register_all();
mod_avformat_alloc_output_context2(&fc, NULL, format, data);
switch_buffer_create_dynamic(&context->audio_buffer, 512, 512, 0);
+ if (!context->audio_buffer) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not allocate buffer for %s\n", path);
+ return SWITCH_STATUS_MEMERR;
+ }
+
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "sample rate: %d, channels: %d\n", handle->samplerate, handle->channels);
av_register_all();