mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-21 09:10:36 +00:00
Merge "rtp_engine: Failed assertion and wrong name given for codec" into 13
This commit is contained in:
@@ -737,6 +737,7 @@ int ast_rtp_codecs_payloads_set_rtpmap_type_rate(struct ast_rtp_codecs *codecs,
|
|||||||
} else {
|
} else {
|
||||||
new_type->format = t->payload_type.format;
|
new_type->format = t->payload_type.format;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new_type->format) {
|
if (new_type->format) {
|
||||||
/* SDP parsing automatically increases the reference count */
|
/* SDP parsing automatically increases the reference count */
|
||||||
new_type->format = ast_format_parse_sdp_fmtp(new_type->format, "");
|
new_type->format = ast_format_parse_sdp_fmtp(new_type->format, "");
|
||||||
@@ -1773,7 +1774,11 @@ static void add_static_payload(int map, struct ast_format *format, int rtp_code)
|
|||||||
int x;
|
int x;
|
||||||
struct ast_rtp_payload_type *type;
|
struct ast_rtp_payload_type *type;
|
||||||
|
|
||||||
ast_assert(map < ARRAY_LEN(static_RTP_PT));
|
/*
|
||||||
|
* ARRAY_LEN's result is cast to an int so 'map' is not autocast to a size_t,
|
||||||
|
* which if negative would cause an assertion.
|
||||||
|
*/
|
||||||
|
ast_assert(map < (int)ARRAY_LEN(static_RTP_PT));
|
||||||
|
|
||||||
ast_rwlock_wrlock(&static_RTP_PT_lock);
|
ast_rwlock_wrlock(&static_RTP_PT_lock);
|
||||||
if (map < 0) {
|
if (map < 0) {
|
||||||
@@ -1784,6 +1789,7 @@ static void add_static_payload(int map, struct ast_format *format, int rtp_code)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (map < 0) {
|
if (map < 0) {
|
||||||
if (format) {
|
if (format) {
|
||||||
ast_log(LOG_WARNING, "No Dynamic RTP mapping available for format %s\n",
|
ast_log(LOG_WARNING, "No Dynamic RTP mapping available for format %s\n",
|
||||||
@@ -1815,14 +1821,10 @@ static void add_static_payload(int map, struct ast_format *format, int rtp_code)
|
|||||||
|
|
||||||
int ast_rtp_engine_load_format(struct ast_format *format)
|
int ast_rtp_engine_load_format(struct ast_format *format)
|
||||||
{
|
{
|
||||||
char *codec_name = ast_strdupa(ast_format_get_name(format));
|
|
||||||
|
|
||||||
codec_name = ast_str_to_upper(codec_name);
|
|
||||||
|
|
||||||
set_next_mime_type(format,
|
set_next_mime_type(format,
|
||||||
0,
|
0,
|
||||||
ast_codec_media_type2str(ast_format_get_type(format)),
|
ast_codec_media_type2str(ast_format_get_type(format)),
|
||||||
codec_name,
|
ast_format_get_codec_name(format),
|
||||||
ast_format_get_sample_rate(format));
|
ast_format_get_sample_rate(format));
|
||||||
add_static_payload(-1, format, 0);
|
add_static_payload(-1, format, 0);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user