From e0b883f581ed0bb0d22410f28a4c88397039f323 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 19 Feb 2013 13:17:24 -0600 Subject: [PATCH] FS-5105 --resolve --- src/include/switch_types.h | 3 ++- src/mod/applications/mod_httapi/mod_httapi.c | 1 + src/switch_core_file.c | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 1fa34bbce2..5fa7c158f0 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -1537,7 +1537,8 @@ typedef enum { SWITCH_FILE_DONE = (1 << 13), SWITCH_FILE_BUFFER_DONE = (1 << 14), SWITCH_FILE_WRITE_APPEND = (1 << 15), - SWITCH_FILE_WRITE_OVER = (1 << 16) + SWITCH_FILE_WRITE_OVER = (1 << 16), + SWITCH_FILE_NOMUX = (1 << 17) } switch_file_flag_enum_t; typedef uint32_t switch_file_flag_t; diff --git a/src/mod/applications/mod_httapi/mod_httapi.c b/src/mod/applications/mod_httapi/mod_httapi.c index 8665e8c3d3..5b205d4e60 100644 --- a/src/mod/applications/mod_httapi/mod_httapi.c +++ b/src/mod/applications/mod_httapi/mod_httapi.c @@ -2756,6 +2756,7 @@ static switch_status_t http_file_file_open(switch_file_handle_t *handle, const c handle->speed = context->fh.speed; handle->interval = context->fh.interval; handle->channels = context->fh.channels; + handle->flags |= SWITCH_FILE_NOMUX; if (switch_test_flag((&context->fh), SWITCH_FILE_NATIVE)) { switch_set_flag(handle, SWITCH_FILE_NATIVE); diff --git a/src/switch_core_file.c b/src/switch_core_file.c index 2841776304..1cf60b5583 100644 --- a/src/switch_core_file.c +++ b/src/switch_core_file.c @@ -194,7 +194,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file, fh->pre_buffer_data = switch_core_alloc(fh->memory_pool, fh->pre_buffer_datalen * fh->channels); } - if (fh->channels > 1 && (flags & SWITCH_FILE_FLAG_READ)) { + if (fh->channels > 1 && (flags & SWITCH_FILE_FLAG_READ) && !(fh->flags & SWITCH_FILE_NOMUX)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "File has %d channels, muxing to mono will occur.\n", fh->channels); } @@ -253,7 +253,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_read(switch_file_handle_t *fh, switch_set_flag(fh, SWITCH_FILE_BUFFER_DONE); } else { fh->samples_in += rlen; - if (fh->channels > 1) { + if (fh->channels > 1 && !switch_test_flag(fh, SWITCH_FILE_NOMUX)) { switch_mux_channels((int16_t *) fh->pre_buffer_data, rlen, fh->channels); } switch_buffer_write(fh->pre_buffer, fh->pre_buffer_data, asis ? rlen : rlen * 2); @@ -280,7 +280,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_read(switch_file_handle_t *fh, fh->samples_in += *len; - if (fh->channels > 1) { + if (fh->channels > 1 && !switch_test_flag(fh, SWITCH_FILE_NOMUX)) { switch_mux_channels((int16_t *) data, *len, fh->channels); }