mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-17 23:38:23 +00:00
just for fun, let's lock the whisper buffer for writing AND reading :-)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38441 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2469,8 +2469,10 @@ int ast_write(struct ast_channel *chan, struct ast_frame *fr)
|
|||||||
.samples = f->samples,
|
.samples = f->samples,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ast_mutex_lock(&chan->whisper->lock);
|
||||||
if (ast_slinfactory_read(&chan->whisper->sf, buf, f->samples))
|
if (ast_slinfactory_read(&chan->whisper->sf, buf, f->samples))
|
||||||
ast_frame_slinear_sum(f, &whisper);
|
ast_frame_slinear_sum(f, &whisper);
|
||||||
|
ast_mutex_unlock(&chan->whisper->lock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user