]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Trivial change to read the number of samples from a frame before calling ast_write()
authorRussell Bryant <russell@russellbryant.com>
Tue, 22 Apr 2008 19:45:00 +0000 (19:45 +0000)
committerRussell Bryant <russell@russellbryant.com>
Tue, 22 Apr 2008 19:45:00 +0000 (19:45 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@114545 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_musiconhold.c

index 31cc39130015cad02b0908e0730cf7a1d45f583d..b2a92ae57e3f600b997f14a8097c702b362e3f29 100644 (file)
@@ -304,8 +304,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));