mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-27 06:31:54 +00:00
Merge "stream: ast_stream_clone() cannot copy the opaque user data."
This commit is contained in:
@@ -126,7 +126,7 @@ void ast_stream_free(struct ast_stream *stream);
|
|||||||
* \retval NULL failure
|
* \retval NULL failure
|
||||||
*
|
*
|
||||||
* \note Opaque data pointers set with ast_stream_set_data() are not part
|
* \note Opaque data pointers set with ast_stream_set_data() are not part
|
||||||
* of the deep clone. The pointers are simply copied.
|
* of the deep clone. We have no way to clone the data.
|
||||||
*
|
*
|
||||||
* \since 15
|
* \since 15
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ struct ast_stream *ast_stream_clone(const struct ast_stream *stream)
|
|||||||
{
|
{
|
||||||
struct ast_stream *new_stream;
|
struct ast_stream *new_stream;
|
||||||
size_t stream_size;
|
size_t stream_size;
|
||||||
|
int idx;
|
||||||
|
|
||||||
if (!stream) {
|
if (!stream) {
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -115,6 +116,12 @@ struct ast_stream *ast_stream_clone(const struct ast_stream *stream)
|
|||||||
ao2_ref(new_stream->formats, +1);
|
ao2_ref(new_stream->formats, +1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* We cannot clone the opaque data because we don't know how. */
|
||||||
|
for (idx = 0; idx < AST_STREAM_DATA_SLOT_MAX; ++idx) {
|
||||||
|
new_stream->data[idx] = NULL;
|
||||||
|
new_stream->data_free_fn[idx] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return new_stream;
|
return new_stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user