summaryrefslogtreecommitdiff
path: root/main/autoservice.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-08-24 13:45:08 -0300
committerJoshua Colp <jcolp@digium.com>2017-08-28 13:09:25 -0300
commit6baf2c26f38ccbfda9c2f09285349d9b59bbbb43 (patch)
treef5a24dec2a6747443126ec3a1f31167a85bdf08a /main/autoservice.c
parentb7c27e1c84c430093961439e5d2a955a9c4f7d81 (diff)
core: Reduce video update queueing.
A video update frame is used to indicate that a channel with video negotiated should provide a full frame so the decoder decoding the stream is able to do so. In situations where a queue is used to store frames it makes no sense for the queue to contain multiple video update frames. One is sufficient to have a full frame be sent. ASTERISK-27222 Change-Id: Id3f40a6f51b740ae4704003a1800185c0c658ee7
Diffstat (limited to 'main/autoservice.c')
-rw-r--r--main/autoservice.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/main/autoservice.c b/main/autoservice.c
index d1a0156ab..cd7388b7d 100644
--- a/main/autoservice.c
+++ b/main/autoservice.c
@@ -58,6 +58,7 @@ struct asent {
* it gets stopped for the last time. */
unsigned int use_count;
unsigned int orig_end_dtmf_flag:1;
+ unsigned int video_update:1;
unsigned int ignore_frame_types;
/*! Frames go on at the head of deferred_frames, so we have the frames
* from newest to oldest. As we put them at the head of the readq, we'll
@@ -161,6 +162,17 @@ static void *autoservice_run(void *ign)
AST_LIST_INSERT_HEAD(&ents[i]->deferred_frames, dup_f, frame_list);
}
} else {
+ if (defer_frame->frametype == AST_FRAME_CONTROL &&
+ defer_frame->subclass.integer == AST_CONTROL_VIDUPDATE) {
+
+ /* If a video update is already queued don't needlessly queue another */
+ if (ents[i]->video_update) {
+ ast_frfree(defer_frame);
+ break;
+ }
+
+ ents[i]->video_update = 1;
+ }
if ((dup_f = ast_frisolate(defer_frame))) {
AST_LIST_INSERT_HEAD(&ents[i]->deferred_frames, dup_f, frame_list);
}