mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
stream: Make ast_stream_topology_create_from_format_cap() allow NULL cap.
Change-Id: Ie29760c49c25d7022ba2124698283181a0dd5d08
This commit is contained in:
@@ -356,7 +356,7 @@ int ast_stream_topology_set_stream(struct ast_stream_topology *topology,
|
|||||||
* creates a topology and separates the media types in format_cap into
|
* creates a topology and separates the media types in format_cap into
|
||||||
* separate streams.
|
* separate streams.
|
||||||
*
|
*
|
||||||
* \param caps The format capabilities structure
|
* \param caps The format capabilities structure (NULL creates an empty topology)
|
||||||
*
|
*
|
||||||
* \retval non-NULL success
|
* \retval non-NULL success
|
||||||
* \retval NULL failure
|
* \retval NULL failure
|
||||||
|
@@ -852,14 +852,10 @@ void ast_channel_nativeformats_set(struct ast_channel *chan,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!ast_channel_is_multistream(chan)) || !value) {
|
if (!ast_channel_is_multistream(chan) || !value) {
|
||||||
struct ast_stream_topology *new_topology;
|
struct ast_stream_topology *new_topology;
|
||||||
|
|
||||||
if (!value) {
|
new_topology = ast_stream_topology_create_from_format_cap(value);
|
||||||
new_topology = ast_stream_topology_alloc();
|
|
||||||
} else {
|
|
||||||
new_topology = ast_stream_topology_create_from_format_cap(value);
|
|
||||||
}
|
|
||||||
ast_channel_internal_set_stream_topology(chan, new_topology);
|
ast_channel_internal_set_stream_topology(chan, new_topology);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -345,11 +345,9 @@ struct ast_stream_topology *ast_stream_topology_create_from_format_cap(
|
|||||||
struct ast_stream_topology *topology;
|
struct ast_stream_topology *topology;
|
||||||
enum ast_media_type type;
|
enum ast_media_type type;
|
||||||
|
|
||||||
ast_assert(cap != NULL);
|
|
||||||
|
|
||||||
topology = ast_stream_topology_alloc();
|
topology = ast_stream_topology_alloc();
|
||||||
if (!topology) {
|
if (!topology || !cap || !ast_format_cap_count(cap)) {
|
||||||
return NULL;
|
return topology;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (type = AST_MEDIA_TYPE_UNKNOWN + 1; type < AST_MEDIA_TYPE_END; type++) {
|
for (type = AST_MEDIA_TYPE_UNKNOWN + 1; type < AST_MEDIA_TYPE_END; type++) {
|
||||||
|
Reference in New Issue
Block a user