diff options
author | Martin Storsjö <martin@martin.st> | 2015-02-25 23:55:58 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2015-02-28 22:53:38 +0200 |
commit | 98563953442560dd83aab938f86de3e5a22a891f (patch) | |
tree | f94ff14e556f9ca26af0e6ea4baadebfb75429aa /libavformat/rtpenc_aac.c | |
parent | 990e4a6639d0714198583c2812b1074b5751898f (diff) | |
download | ffmpeg-98563953442560dd83aab938f86de3e5a22a891f.tar.gz |
rtpenc_aac: Fix sending fragmented frames
After sending a fragmented frame, len (s->buf_ptr - s->buf) isn't
zero, while s->num_frames is zero as intended. Using s->num_frames
makes it work as intended, and is less convoluted than keeping track
of (resetting) s->buf_ptr.
This avoids sending stray data after sending a fragmented aac packet.
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtpenc_aac.c')
-rw-r--r-- | libavformat/rtpenc_aac.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/rtpenc_aac.c b/libavformat/rtpenc_aac.c index 1b2fa0a78c..8e39605979 100644 --- a/libavformat/rtpenc_aac.c +++ b/libavformat/rtpenc_aac.c @@ -39,7 +39,7 @@ 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 == max_frames_per_packet) || (len && (len + size) > s->max_payload_size)) { + if ((s->num_frames == max_frames_per_packet) || (s->num_frames && (len + size) > s->max_payload_size)) { int au_size = s->num_frames * 2; p = s->buf + max_au_headers_size - au_size - 2; |