]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Handle cases where a frame may have no data. (issue #9519 reported by dmb)
authorJoshua Colp <jcolp@digium.com>
Tue, 29 May 2007 16:44:34 +0000 (16:44 +0000)
committerJoshua Colp <jcolp@digium.com>
Tue, 29 May 2007 16:44:34 +0000 (16:44 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66437 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/rtp.c

index 8a74fb22230b61a6b4754d5e6eed6bc6a136c926..9f2eb7f8394595ed25c73b62d95d61b1abda17c1 100644 (file)
@@ -2743,7 +2743,7 @@ int ast_rtp_write(struct ast_rtp *rtp, struct ast_frame *_f)
                        ast_smoother_feed(rtp->smoother, _f);
                }
 
-               while((f = ast_smoother_read(rtp->smoother)))
+               while((f = ast_smoother_read(rtp->smoother)) && (f->data))
                        ast_rtp_raw_write(rtp, f, codec);
        } else {
                /* Don't buffer outgoing frames; send them one-per-packet: */
@@ -2752,7 +2752,8 @@ int ast_rtp_write(struct ast_rtp *rtp, struct ast_frame *_f)
                } else {
                        f = _f;
                }
-               ast_rtp_raw_write(rtp, f, codec);
+               if (f->data)
+                       ast_rtp_raw_write(rtp, f, codec);
                if (f != _f)
                        ast_frfree(f);
        }