mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 12:40:17 +00:00
FS-10480: [mod_av] fix crash recording an audio only stream to an rtmp stream
This commit is contained in:
parent
aba1068e09
commit
69cb420ca9
@ -1948,7 +1948,7 @@ static switch_status_t av_file_open(switch_file_handle_t *handle, const char *pa
|
||||
|
||||
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",
|
||||
@ -1956,7 +1956,7 @@ static switch_status_t av_file_open(switch_file_handle_t *handle, const char *pa
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user