diff options
author | Richard Mudgett <rmudgett@digium.com> | 2017-04-20 19:25:10 -0500 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2017-04-27 19:08:05 -0500 |
commit | 5c1851cbc0e31cc1fee108983b1937212002860c (patch) | |
tree | c7e86ac58391a8223a153ac7019a91680f062f10 /main/stream.c | |
parent | d71c6e3bfd0db7b069da326c155766b679de552f (diff) |
stream: Make ast_stream_topology_create_from_format_cap() allow NULL cap.
Change-Id: Ie29760c49c25d7022ba2124698283181a0dd5d08
Diffstat (limited to 'main/stream.c')
-rw-r--r-- | main/stream.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/main/stream.c b/main/stream.c index cf2633e1b..39b6b1b13 100644 --- a/main/stream.c +++ b/main/stream.c @@ -345,11 +345,9 @@ struct ast_stream_topology *ast_stream_topology_create_from_format_cap( struct ast_stream_topology *topology; enum ast_media_type type; - ast_assert(cap != NULL); - topology = ast_stream_topology_alloc(); - if (!topology) { - return NULL; + if (!topology || !cap || !ast_format_cap_count(cap)) { + return topology; } for (type = AST_MEDIA_TYPE_UNKNOWN + 1; type < AST_MEDIA_TYPE_END; type++) { |