Skip to content

Commit

Permalink
rtpenc_aac: Fix sending fragmented frames
Browse files Browse the repository at this point in the history
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: [email protected]
Signed-off-by: Martin Storsjö <[email protected]>
  • Loading branch information
mstorsjo committed Feb 28, 2015
1 parent 990e4a6 commit 9856395
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libavformat/rtpenc_aac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9856395

Please sign in to comment.