summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2009-05-07 16:51:17 +0000
committerNanang Izzuddin <nanang@teluu.com>2009-05-07 16:51:17 +0000
commit02f03e0152e60d5989bebaa763eba37884d44d72 (patch)
treef3c6964c0ba33ad856469ca8e9829ac89c238418
parent51271c4f767276e049a11f3cb783cc6958d565d0 (diff)
Ticket #820: Fixed sound port to return zero-filled audio frame when there is 'problem' getting frame from remote port ('no_frame' label), this seems to fix stutter noise issue on Mac.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2685 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjmedia/src/pjmedia/sound_port.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/pjmedia/src/pjmedia/sound_port.c b/pjmedia/src/pjmedia/sound_port.c
index 7117c82b..70c71215 100644
--- a/pjmedia/src/pjmedia/sound_port.c
+++ b/pjmedia/src/pjmedia/sound_port.c
@@ -66,7 +66,7 @@ static pj_status_t play_cb(void *user_data, pjmedia_frame *frame)
{
pjmedia_snd_port *snd_port = (pjmedia_snd_port*) user_data;
pjmedia_port *port;
- unsigned required_size = frame->size;
+ const unsigned required_size = frame->size;
pj_status_t status;
port = snd_port->port;
@@ -81,7 +81,6 @@ static pj_status_t play_cb(void *user_data, pjmedia_frame *frame)
goto no_frame;
/* Must supply the required samples */
- PJ_UNUSED_ARG(required_size);
pj_assert(frame->size == required_size);
if (snd_port->ec_state) {
@@ -98,6 +97,9 @@ static pj_status_t play_cb(void *user_data, pjmedia_frame *frame)
return PJ_SUCCESS;
no_frame:
+ frame->type = PJMEDIA_FRAME_TYPE_AUDIO;
+ frame->size = required_size;
+ pj_bzero(frame->buf, frame->size);
if (snd_port->ec_state && !snd_port->ec_suspended) {
++snd_port->ec_suspend_count;