Merged revisions 19347 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r19347 | kpfleming | 2006-04-11 16:35:52 -0500 (Tue, 11 Apr 2006) | 2 lines

simplify spy queue flushing logic, and always force a flush when one side gets full, even if the other side is not empty (issue #6457)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@19349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Kevin P. Fleming 19 years ago
parent f515078c53
commit 7bf8d36c8b

@ -1271,7 +1271,6 @@ static void queue_frame_to_spies(struct ast_channel *chan, struct ast_frame *f,
struct ast_frame *translated_frame = NULL;
struct ast_channel_spy *spy;
struct ast_channel_spy_queue *queue;
struct ast_channel_spy_queue *other_queue;
struct channel_spy_trans *trans;
struct ast_frame *last;
@ -1333,9 +1332,6 @@ static void queue_frame_to_spies(struct ast_channel *chan, struct ast_frame *f,
if (queue->samples > SPY_QUEUE_SAMPLE_LIMIT) {
if (ast_test_flag(spy, CHANSPY_TRIGGER_MODE) != CHANSPY_TRIGGER_NONE) {
other_queue = (dir == SPY_WRITE) ? &spy->read_queue : &spy->write_queue;
if (other_queue->samples == 0) {
switch (ast_test_flag(spy, CHANSPY_TRIGGER_MODE)) {
case CHANSPY_TRIGGER_READ:
if (dir == SPY_WRITE) {
@ -1361,11 +1357,7 @@ static void queue_frame_to_spies(struct ast_channel *chan, struct ast_frame *f,
spy->type, chan->name);
ast_set_flag(spy, CHANSPY_TRIGGER_FLUSH);
ast_cond_signal(&spy->trigger);
ast_mutex_unlock(&spy->lock);
continue;
}
}
} else {
if (option_debug)
ast_log(LOG_DEBUG, "Spy '%s' on channel '%s' %s queue too long, dropping frames\n",
spy->type, chan->name, (dir == SPY_READ) ? "read" : "write");
@ -1376,6 +1368,7 @@ static void queue_frame_to_spies(struct ast_channel *chan, struct ast_frame *f,
queue->head = drop->next;
ast_frfree(drop);
}
}
} else {
switch (ast_test_flag(spy, CHANSPY_TRIGGER_MODE)) {
case CHANSPY_TRIGGER_READ:

Loading…
Cancel
Save