mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
Trivial change to read the number of samples from a frame before calling ast_write()
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114545 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -304,8 +304,8 @@ static int moh_files_generator(struct ast_channel *chan, void *data, int len, in
|
|||||||
while (state->sample_queue > 0) {
|
while (state->sample_queue > 0) {
|
||||||
if ((f = moh_files_readframe(chan))) {
|
if ((f = moh_files_readframe(chan))) {
|
||||||
state->samples += f->samples;
|
state->samples += f->samples;
|
||||||
res = ast_write(chan, f);
|
|
||||||
state->sample_queue -= f->samples;
|
state->sample_queue -= f->samples;
|
||||||
|
res = ast_write(chan, f);
|
||||||
ast_frfree(f);
|
ast_frfree(f);
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
ast_log(LOG_WARNING, "Failed to write frame to '%s': %s\n", chan->name, strerror(errno));
|
ast_log(LOG_WARNING, "Failed to write frame to '%s': %s\n", chan->name, strerror(errno));
|
||||||
|
Reference in New Issue
Block a user