mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-20 19:53:10 +00:00
stream: Ignore declined streams for some topology calls.
* Made ast_format_cap_from_stream_topology() not include any formats from declined streams. * Made ast_stream_topology_get_first_stream_by_type() ignore declined streams to return the first active stream of the type. * Updated unit tests to check these changes have the expected effect. Change-Id: Iabbc6a3e8edf263a25fd3056c3c614407c7897df
This commit is contained in:
@@ -437,9 +437,11 @@ struct ast_format_cap *ast_format_cap_from_stream_topology(
|
||||
}
|
||||
|
||||
for (i = 0; i < AST_VECTOR_SIZE(&topology->streams); i++) {
|
||||
struct ast_stream *stream = AST_VECTOR_GET(&topology->streams, i);
|
||||
struct ast_stream *stream;
|
||||
|
||||
if (!stream->formats) {
|
||||
stream = AST_VECTOR_GET(&topology->streams, i);
|
||||
if (!stream->formats
|
||||
|| stream->state == AST_STREAM_STATE_REMOVED) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -458,9 +460,11 @@ struct ast_stream *ast_stream_topology_get_first_stream_by_type(
|
||||
ast_assert(topology != NULL);
|
||||
|
||||
for (i = 0; i < AST_VECTOR_SIZE(&topology->streams); i++) {
|
||||
struct ast_stream *stream = AST_VECTOR_GET(&topology->streams, i);
|
||||
struct ast_stream *stream;
|
||||
|
||||
if (stream->type == type) {
|
||||
stream = AST_VECTOR_GET(&topology->streams, i);
|
||||
if (stream->type == type
|
||||
&& stream->state != AST_STREAM_STATE_REMOVED) {
|
||||
return stream;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user