diff options
Diffstat (limited to 'res/res_musiconhold.c')
-rw-r--r-- | res/res_musiconhold.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index 1b44b3dfd..e7044eff9 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -312,8 +312,8 @@ static int moh_files_generator(struct ast_channel *chan, void *data, int len, in while (state->sample_queue > 0) { if ((f = moh_files_readframe(chan))) { state->samples += f->samples; - res = ast_write(chan, f); state->sample_queue -= f->samples; + res = ast_write(chan, f); ast_frfree(f); if (res < 0) { ast_log(LOG_WARNING, "Failed to write frame to '%s': %s\n", chan->name, strerror(errno)); |