1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

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>
This commit is contained in:
Martin Storsjö
2015-02-27 12:30:54 +02:00
parent 9856395344
commit 12b3459979

View File

@@ -36,7 +36,7 @@ void ff_rtp_send_amr(AVFormatContext *s1, const uint8_t *buff, int size)
/* Test if the packet must be sent. */ /* Test if the packet must be sent. */
len = s->buf_ptr - s->buf; 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; int header_size = s->num_frames + 1;
p = s->buf + max_header_toc_size - header_size; p = s->buf + max_header_toc_size - header_size;
if (p != s->buf) if (p != s->buf)