summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
Diffstat (limited to 'res')
-rw-r--r--res/res_resolver_unbound.c10
-rw-r--r--res/res_rtp_asterisk.c8
2 files changed, 17 insertions, 1 deletions
diff --git a/res/res_resolver_unbound.c b/res/res_resolver_unbound.c
index 1877bbcc4..3c7805010 100644
--- a/res/res_resolver_unbound.c
+++ b/res/res_resolver_unbound.c
@@ -286,13 +286,21 @@ static void unbound_resolver_callback(void *data, int err, struct ub_result *ub_
ub_resolve_free(ub_result);
}
+static void unbound_resolver_data_dtor(void *vdoomed)
+{
+ struct unbound_resolver_data *doomed = vdoomed;
+
+ ao2_cleanup(doomed->resolver);
+}
+
static int unbound_resolver_resolve(struct ast_dns_query *query)
{
struct unbound_config *cfg = ao2_global_obj_ref(globals);
struct unbound_resolver_data *data;
int res;
- data = ao2_alloc_options(sizeof(*data), NULL, AO2_ALLOC_OPT_LOCK_NOLOCK);
+ data = ao2_alloc_options(sizeof(*data), unbound_resolver_data_dtor,
+ AO2_ALLOC_OPT_LOCK_NOLOCK);
if (!data) {
ast_log(LOG_ERROR, "Failed to allocate resolver data for resolution of '%s'\n",
ast_dns_query_get_name(query));
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index c4608db6c..3d124000a 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -3630,6 +3630,11 @@ static int ast_rtp_write(struct ast_rtp_instance *instance, struct ast_frame *fr
/* If no smoother is present see if we have to set one up */
if (!rtp->smoother && ast_format_can_be_smoothed(format)) {
unsigned int framing_ms = ast_rtp_codecs_get_framing(ast_rtp_instance_get_codecs(instance));
+ int is_slinear = ast_format_cache_is_slinear(format);
+
+ if (!framing_ms && is_slinear) {
+ framing_ms = ast_format_get_default_ms(format);
+ }
if (framing_ms) {
rtp->smoother = ast_smoother_new((framing_ms * ast_format_get_minimum_bytes(format)) / ast_format_get_minimum_ms(format));
@@ -3638,6 +3643,9 @@ static int ast_rtp_write(struct ast_rtp_instance *instance, struct ast_frame *fr
ast_format_get_name(format), framing_ms, ast_format_get_minimum_bytes(format));
return -1;
}
+ if (is_slinear) {
+ ast_smoother_set_flags(rtp->smoother, AST_SMOOTHER_FLAG_BE);
+ }
}
}