summaryrefslogtreecommitdiff
path: root/libavformat/rtp_aac.c
diff options
context:
space:
mode:
authorLuca Abeni <lucabe72@email.it>2009-04-09 21:48:45 +0000
committerLuca Abeni <lucabe72@email.it>2009-04-09 21:48:45 +0000
commit93319670077be9caa58aeed99419e291c172fd36 (patch)
treec5a1c62ccdfcaede1fa9a8c817527e59eefa2524 /libavformat/rtp_aac.c
parentddffcb2d3a81e203cff6f3e39e40bf5720f7391e (diff)
AAC packetiser cleanup: use consts instead of #defines
Originally committed as revision 18402 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtp_aac.c')
-rw-r--r--libavformat/rtp_aac.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/rtp_aac.c b/libavformat/rtp_aac.c
index bdf5f5d450..b597bb16b4 100644
--- a/libavformat/rtp_aac.c
+++ b/libavformat/rtp_aac.c
@@ -21,28 +21,28 @@
#include "avformat.h"
#include "rtpenc.h"
-#define MAX_FRAMES_PER_PACKET (s->max_frames_per_packet ? s->max_frames_per_packet : 5)
-#define MAX_AU_HEADERS_SIZE (2 + 2 * MAX_FRAMES_PER_PACKET)
void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size)
{
RTPMuxContext *s = s1->priv_data;
int len, max_packet_size;
uint8_t *p;
+ const int max_frames_per_packet = s->max_frames_per_packet ? s->max_frames_per_packet : 5;
+ const int max_au_headers_size = 2 + 2 * max_frames_per_packet;
/* skip ADTS header, if present */
if ((s1->streams[0]->codec->extradata_size) == 0) {
size -= 7;
buff += 7;
}
- max_packet_size = s->max_payload_size - MAX_AU_HEADERS_SIZE;
+ max_packet_size = s->max_payload_size - max_au_headers_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) || (len && (len + size) > s->max_payload_size)) {
int au_size = s->num_frames * 2;
- p = s->buf + MAX_AU_HEADERS_SIZE - au_size - 2;
+ p = s->buf + max_au_headers_size - au_size - 2;
if (p != s->buf) {
memmove(p + 2, s->buf + 2, au_size);
}
@@ -55,7 +55,7 @@ void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size)
s->num_frames = 0;
}
if (s->num_frames == 0) {
- s->buf_ptr = s->buf + MAX_AU_HEADERS_SIZE;
+ s->buf_ptr = s->buf + max_au_headers_size;
s->timestamp = s->cur_timestamp;
}