From bde2bba45c2f2df27a8534028bda09a6e7f835e2 Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Fri, 27 Feb 2015 12:32:42 +0200 Subject: rtpenc: Restructure if statements in packetizers to simplify adding more conditions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Factorize out the s->num_frames check at the start of the if statements, simplifying adding more alternative causes for sending the buffered frames. Signed-off-by: Martin Storsjö --- libavformat/rtpenc_aac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libavformat/rtpenc_aac.c') diff --git a/libavformat/rtpenc_aac.c b/libavformat/rtpenc_aac.c index 0a74e27ca4..7805ab9034 100644 --- a/libavformat/rtpenc_aac.c +++ b/libavformat/rtpenc_aac.c @@ -39,7 +39,9 @@ void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size) /* test if the packet must be sent */ len = (s->buf_ptr - s->buf); - if ((s->num_frames == s->max_frames_per_packet) || (s->num_frames && (len + size) > s->max_payload_size)) { + if (s->num_frames && + (s->num_frames == s->max_frames_per_packet || + (len + size) > s->max_payload_size)) { int au_size = s->num_frames * 2; p = s->buf + max_au_headers_size - au_size - 2; -- cgit v1.2.3