diff options
author | Martin Storsjö <martin@martin.st> | 2015-02-27 12:30:54 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2015-02-28 22:53:42 +0200 |
commit | 12b3459979f5ea6481660cd2c99a0381e2b5ba37 (patch) | |
tree | 79337c0602ed2b3f6f02f0bd8598746cda52fcd8 | |
parent | 98563953442560dd83aab938f86de3e5a22a891f (diff) | |
download | ffmpeg-12b3459979f5ea6481660cd2c99a0381e2b5ba37.tar.gz |
rtpenc_amr: Use s->num_frames instead of s->buf_ptr - s->buf
This doesn't fix any bug, but makes the code simpler for later
patches, and more straightforward to read as is.
Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r-- | libavformat/rtpenc_amr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/rtpenc_amr.c b/libavformat/rtpenc_amr.c index 73da8c8251..9f4f21a1de 100644 --- a/libavformat/rtpenc_amr.c +++ b/libavformat/rtpenc_amr.c @@ -36,7 +36,7 @@ void ff_rtp_send_amr(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 || (len && len + size - 1 > s->max_payload_size)) { + if (s->num_frames == s->max_frames_per_packet || (s->num_frames && len + size - 1 > s->max_payload_size)) { int header_size = s->num_frames + 1; p = s->buf + max_header_toc_size - header_size; if (p != s->buf) |