diff options
author | Jenkins2 <jenkins2@gerrit.asterisk.org> | 2017-08-29 06:13:05 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-08-29 06:13:05 -0500 |
commit | d05ab9e91a05725fb7cde40d217497b224a106d0 (patch) | |
tree | c3a7fe0906d8f9c6e7369f96c477891c546dd898 /main | |
parent | 87f6dd2ef3c340bb85b863d1a1fa300e0c2b96fe (diff) | |
parent | 6baf2c26f38ccbfda9c2f09285349d9b59bbbb43 (diff) |
Merge "core: Reduce video update queueing." into 15
Diffstat (limited to 'main')
-rw-r--r-- | main/autoservice.c | 12 | ||||
-rw-r--r-- | main/core_unreal.c | 3 |
2 files changed, 14 insertions, 1 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); } diff --git a/main/core_unreal.c b/main/core_unreal.c index 3db6a4dbd..763be4f0c 100644 --- a/main/core_unreal.c +++ b/main/core_unreal.c @@ -330,7 +330,8 @@ int ast_unreal_write(struct ast_channel *ast, struct ast_frame *f) if (!ast_channel_get_default_stream(ast, AST_MEDIA_TYPE_AUDIO)) { return 0; } - } else if (f->frametype == AST_FRAME_VIDEO) { + } else if (f->frametype == AST_FRAME_VIDEO || + (f->frametype == AST_FRAME_CONTROL && f->subclass.integer == AST_CONTROL_VIDUPDATE)) { if (!ast_channel_get_default_stream(ast, AST_MEDIA_TYPE_VIDEO)) { return 0; } |