diff options
author | Martin Storsjö <martin@martin.st> | 2015-02-27 12:32:42 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2015-02-28 22:54:26 +0200 |
commit | bde2bba45c2f2df27a8534028bda09a6e7f835e2 (patch) | |
tree | 73dcf2a4ee78c96eab14c627600aa1c7a87851e6 /libavformat/rtpenc_xiph.c | |
parent | d4c7fc02f9f59e721e76debf4a595df529707545 (diff) | |
download | ffmpeg-bde2bba45c2f2df27a8534028bda09a6e7f835e2.tar.gz |
rtpenc: Restructure if statements in packetizers to simplify adding more conditions
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ö <martin@martin.st>
Diffstat (limited to 'libavformat/rtpenc_xiph.c')
-rw-r--r-- | libavformat/rtpenc_xiph.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/rtpenc_xiph.c b/libavformat/rtpenc_xiph.c index 7d8883a353..2167bdc99f 100644 --- a/libavformat/rtpenc_xiph.c +++ b/libavformat/rtpenc_xiph.c @@ -75,8 +75,9 @@ void ff_rtp_send_xiph(AVFormatContext *s1, const uint8_t *buff, int size) int remaining = end_ptr - ptr; assert(s->num_frames <= s->max_frames_per_packet); - if ((s->num_frames > 0 && remaining < 0) || - s->num_frames == s->max_frames_per_packet) { + if (s->num_frames > 0 && + (remaining < 0 || + s->num_frames == s->max_frames_per_packet)) { // send previous packets now; no room for new data ff_rtp_send_data(s1, s->buf, s->buf_ptr - s->buf, 0); s->num_frames = 0; |