Merging the issue11259 branch.

The purpose of this branch was to take into account
"burps" which could cause jitterbuffers to misbehave.
One such example is if the L option to Dial() were used
to inject audio into a bridged conversation at regular
intervals. Since the audio here was not passed through
the jitterbuffer, it would cause a gap in the jitterbuffer's
timestamps which would cause a frames to be dropped for a 
brief period.

Now ast_generic_bridge will empty and reset the jitterbuffer
each time it is called. This causes injected audio to be handled
properly.

ast_generic_bridge also will empty and reset the jitterbuffer
if it receives an AST_CONTROL_SRCUPDATE frame since the change
in audio source could negatively affect the jitterbuffer.

All of this was made possible by adding a new public API call
to the abstract_jb called ast_jb_empty_and_reset.

(closes issue #11259)
Reported by: plack
Tested by: putnopvut



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@135841 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Michelson
2008-08-06 00:25:10 +00:00
parent ee8adb313e
commit b8bbf8b61a
5 changed files with 75 additions and 24 deletions

View File

@@ -3779,6 +3779,8 @@ static enum ast_bridge_result ast_generic_bridge(struct ast_channel *c0, struct
/* Check the need of a jitterbuffer for each channel */
jb_in_use = ast_jb_do_usecheck(c0, c1);
if (jb_in_use)
ast_jb_empty_and_reset(c0, c1);
for (;;) {
struct ast_channel *who, *other;
@@ -3843,6 +3845,9 @@ static enum ast_bridge_result ast_generic_bridge(struct ast_channel *c0, struct
case AST_CONTROL_VIDUPDATE:
case AST_CONTROL_SRCUPDATE:
ast_indicate_data(other, f->subclass, f->data, f->datalen);
if (jb_in_use) {
ast_jb_empty_and_reset(c0, c1);
}
break;
default:
*fo = f;