FS-11547: [core] Fix broken record_sample_rate variable.

This commit is contained in:
Andrey Volk 2018-12-04 00:31:36 +04:00 committed by Andrey Volk
parent 972b3a3128
commit 82452988e2
2 changed files with 8 additions and 5 deletions

View File

@ -81,10 +81,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file,
}
fh->samples_in = 0;
fh->samplerate = 0;
fh->native_rate = 0;
fh->channels = 0;
fh->real_channels = 0;
if (!(flags & SWITCH_FILE_FLAG_WRITE)) {
fh->samplerate = 0;
fh->native_rate = 0;
fh->channels = 0;
fh->real_channels = 0;
}
if (!fh->samplerate) {
if (!(fh->samplerate = rate)) {

View File

@ -1322,7 +1322,7 @@ static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, s
switch_core_session_get_read_impl(session, &rh->read_impl);
if (rh->fh) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Record session sample rate: %d -> %d\n", rh->fh->native_rate, rh->read_impl.actual_samples_per_second);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Record session sample rate: %d -> %d\n", rh->fh->native_rate, rh->fh->samplerate);
rh->fh->native_rate = rh->read_impl.actual_samples_per_second;
if (switch_core_file_has_video(rh->fh, SWITCH_TRUE)) {
switch_core_media_bug_set_media_params(bug, &rh->fh->mm);