if (!(context->w && context->h)) return;
- w = context->w;
h = context->h;
if (overlay->fontsz) {
if (!text) text = overlay->text;
- int len = strlen(text);
-
- if (len < 5) len = 5;
-
//width = (int) (float)(font_size * .95f * len);
switch_color_set_rgb(&bgcolor, overlay->bg);
}
shape_w = context->shape[0].w;
- shape_h = context->shape[0].h;
cx = context->shape[0].cx;
cy = context->shape[0].cy;
} else if (!strcasecmp(name, "allclear")) {
for (int x = context->overlay_count - 1; x >= 0; x--) {
png_idx = clear_overlay(context, x);
- context->overlay[x]->xo = context->overlay[x]->yo = context->overlay[x]->shape_scale = 0.0f;
- context->overlay[x]->zidx = 0;
- context->overlay[x]->scale_w = context->overlay[x]->scale_h = 0;
- context->overlay[x]->shape_scale = 1;
+ if (context->overlay[x]) {
+ context->overlay[x]->xo = context->overlay[x]->yo = context->overlay[x]->shape_scale = 0.0f;
+ context->overlay[x]->zidx = 0;
+ context->overlay[x]->scale_w = context->overlay[x]->scale_h = 0;
+ context->overlay[x]->shape_scale = 1;
+ }
}
} else if (!strcasecmp(name, "home")) {
context->overlay[png_idx]->xo = context->overlay[png_idx]->yo = context->overlay[png_idx]->shape_scale = 0.0f;
{
cv_context_t *context = (cv_context_t *) user_data;
- switch_channel_t *channel = switch_core_session_get_channel(context->session);
+ switch_channel_t *channel;
switch (type) {
case SWITCH_ABC_TYPE_INIT:
parse_params(context, 1, argc, argv);
}
- if (!strcasecmp(argv[0], "patch") || !strcasecmp(argv[1], "patch")) {
+ if ((argv[0] && !strcasecmp(argv[0], "patch")) ||(argv[1] && !strcasecmp(argv[1], "patch"))) {
function = "patch:video";
flags = SMBF_VIDEO_PATCH;
}