Merged revisions 90142 via svnmerge from
[asterisk/asterisk.git] / main / file.c
index be5c019..bbdda4c 100644 (file)
@@ -119,6 +119,8 @@ int ast_format_unregister(const char *name)
 
 int ast_stopstream(struct ast_channel *tmp)
 {
+       ast_channel_lock(tmp);
+
        /* Stop a running stream if there is one */
        if (tmp->stream) {
                ast_closestream(tmp->stream);
@@ -131,6 +133,9 @@ int ast_stopstream(struct ast_channel *tmp)
                ast_closestream(tmp->vstream);
                tmp->vstream = NULL;
        }
+
+       ast_channel_unlock(tmp);
+
        return 0;
 }