From 363975b740a54bdf305b35483c19e0476e907aa8 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 25 Jun 2015 10:43:14 +0200 Subject: [PATCH] fix bug in video codec enablement --- coreapi/misc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/coreapi/misc.c b/coreapi/misc.c index 8d7d8939e..d34b2de89 100644 --- a/coreapi/misc.c +++ b/coreapi/misc.c @@ -224,9 +224,9 @@ void linphone_core_update_allocated_audio_bandwidth(LinphoneCore *lc){ } } -bool_t linphone_core_is_payload_type_usable_for_bandwidth(LinphoneCore *lc, const PayloadType *pt, int bandwidth_limit) -{ +bool_t linphone_core_is_payload_type_usable_for_bandwidth(LinphoneCore *lc, const PayloadType *pt, int bandwidth_limit){ double codec_band; + const int video_enablement_limit = 128; bool_t ret=FALSE; switch (pt->type){ @@ -237,7 +237,7 @@ bool_t linphone_core_is_payload_type_usable_for_bandwidth(LinphoneCore *lc, cons /*ms_message("Payload %s: codec_bandwidth=%g, bandwidth_limit=%i",pt->mime_type,codec_band,bandwidth_limit);*/ break; case PAYLOAD_VIDEO: - if (bandwidth_limit!=0) {/* infinite (-1) or strictly positive*/ + if (bandwidth_limit<=0 || bandwidth_limit >= video_enablement_limit) {/* infinite or greater than video_enablement_limit*/ ret=TRUE; } else ret=FALSE;