fmt = context->fc->oformat;
- if ((tmp = switch_event_get_header(handle->params, "av_audio_codec"))) {
+ if (handle->params && (tmp = switch_event_get_header(handle->params, "av_audio_codec"))) {
if ((context->audio_codec = avcodec_find_encoder_by_name(tmp))) {
fmt->audio_codec = context->audio_codec->id;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "specified audio codec %s %s [%s]\n",
}
}
- if (!strcasecmp(ext, "wav") || switch_true(switch_event_get_header(handle->params, "av_record_audio_only"))) {
+ if (!strcasecmp(ext, "wav") || (handle->params && switch_true(switch_event_get_header(handle->params, "av_record_audio_only")))) {
context->has_video = 0;
switch_clear_flag(handle, SWITCH_FILE_FLAG_VIDEO);
}