From 9eaa28a9e8fdc9ab8cb654cb01db54020985e48f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 8 Mar 2007 14:59:10 +0000 Subject: [PATCH] pass frame data better git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4480 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_core.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/switch_core.c b/src/switch_core.c index 5f6e120db1..38148e1a89 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -2199,12 +2199,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi session->enc_read_frame.codec = session->read_codec; session->enc_read_frame.samples = session->read_codec->implementation->bytes_per_frame / sizeof(int16_t); session->enc_read_frame.timestamp = read_frame->timestamp; + session->enc_read_frame.payload = session->read_codec->implementation->ianacode; *frame = &session->enc_read_frame; break; case SWITCH_STATUS_NOOP: session->raw_read_frame.codec = session->read_codec; - session->raw_read_frame.samples = session->read_codec->implementation->bytes_per_frame / sizeof(int16_t); + session->raw_read_frame.samples = enc_frame->codec->implementation->samples_per_frame; session->raw_read_frame.timestamp = read_frame->timestamp; + session->raw_read_frame.payload = enc_frame->codec->implementation->ianacode; *frame = &session->raw_read_frame; status = SWITCH_STATUS_SUCCESS; break; @@ -2465,13 +2467,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess session->enc_write_frame.codec = session->write_codec; session->enc_write_frame.samples = enc_frame->datalen / sizeof(int16_t); session->enc_write_frame.timestamp = frame->timestamp; + session->enc_write_frame.payload = session->write_codec->implementation->ianacode; write_frame = &session->enc_write_frame; break; case SWITCH_STATUS_NOOP: enc_frame->codec = session->write_codec; enc_frame->samples = enc_frame->datalen / sizeof(int16_t); enc_frame->timestamp = frame->timestamp; - + enc_frame->payload = enc_frame->codec->implementation->ianacode; write_frame = enc_frame; status = SWITCH_STATUS_SUCCESS; break; @@ -2519,7 +2522,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess session->enc_write_frame.codec = session->write_codec; session->enc_write_frame.samples = enc_frame->datalen / sizeof(int16_t); session->enc_write_frame.timestamp = frame->timestamp; - + session->enc_write_frame.payload = session->write_codec->implementation->ianacode; write_frame = &session->enc_write_frame; if (!session->read_resampler) { status = switch_resample_create(&session->read_resampler, @@ -2534,12 +2537,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess session->enc_write_frame.codec = session->write_codec; session->enc_write_frame.samples = enc_frame->datalen / sizeof(int16_t); session->enc_write_frame.timestamp = frame->timestamp; + session->enc_write_frame.payload = session->write_codec->implementation->ianacode; write_frame = &session->enc_write_frame; break; case SWITCH_STATUS_NOOP: enc_frame->codec = session->write_codec; enc_frame->samples = enc_frame->datalen / sizeof(int16_t); enc_frame->timestamp = frame->timestamp; + enc_frame->payload = enc_frame->codec->implementation->ianacode; write_frame = enc_frame; status = SWITCH_STATUS_SUCCESS; break;