mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-26 22:30:28 +00:00
Merged revisions 90142 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r90142 | russell | 2007-11-28 18:06:08 -0600 (Wed, 28 Nov 2007) | 4 lines Merge a change from team/russell/chan_refcount ... This makes ast_stopstream() thread-safe. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@90143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -66,9 +66,14 @@ int ast_stream_and_wait(struct ast_channel *chan, const char *file, const char *
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Stops a stream
|
* \brief Stops a stream
|
||||||
|
*
|
||||||
* \param c The channel you wish to stop playback on
|
* \param c The channel you wish to stop playback on
|
||||||
|
*
|
||||||
* Stop playback of a stream
|
* Stop playback of a stream
|
||||||
* \return 0 regardless
|
*
|
||||||
|
* \retval 0 always
|
||||||
|
*
|
||||||
|
* \note The channel does not need to be locked before calling this function.
|
||||||
*/
|
*/
|
||||||
int ast_stopstream(struct ast_channel *c);
|
int ast_stopstream(struct ast_channel *c);
|
||||||
|
|
||||||
|
|||||||
@@ -119,6 +119,8 @@ int ast_format_unregister(const char *name)
|
|||||||
|
|
||||||
int ast_stopstream(struct ast_channel *tmp)
|
int ast_stopstream(struct ast_channel *tmp)
|
||||||
{
|
{
|
||||||
|
ast_channel_lock(tmp);
|
||||||
|
|
||||||
/* Stop a running stream if there is one */
|
/* Stop a running stream if there is one */
|
||||||
if (tmp->stream) {
|
if (tmp->stream) {
|
||||||
ast_closestream(tmp->stream);
|
ast_closestream(tmp->stream);
|
||||||
@@ -131,6 +133,9 @@ int ast_stopstream(struct ast_channel *tmp)
|
|||||||
ast_closestream(tmp->vstream);
|
ast_closestream(tmp->vstream);
|
||||||
tmp->vstream = NULL;
|
tmp->vstream = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ast_channel_unlock(tmp);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user