diff options
author | Martin Storsjö <martin@martin.st> | 2015-02-25 23:34:36 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2015-02-28 22:53:46 +0200 |
commit | 0662440b991361fdb5e732712d997a73e4692e34 (patch) | |
tree | cba447dad3eaf8c291d67e128dd01e96388c332b /libavformat/rtpenc_aac.c | |
parent | 12b3459979f5ea6481660cd2c99a0381e2b5ba37 (diff) | |
download | ffmpeg-0662440b991361fdb5e732712d997a73e4692e34.tar.gz |
rtpenc_aac: Set a default value for max_frames_per_packet at init
This avoids having to conditionally set the default within the
packetizer function.
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtpenc_aac.c')
-rw-r--r-- | libavformat/rtpenc_aac.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libavformat/rtpenc_aac.c b/libavformat/rtpenc_aac.c index 8e39605979..7dcdec9499 100644 --- a/libavformat/rtpenc_aac.c +++ b/libavformat/rtpenc_aac.c @@ -27,8 +27,7 @@ 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; + const int max_au_headers_size = 2 + 2 * s->max_frames_per_packet; /* skip ADTS header, if present */ if ((s1->streams[0]->codec->extradata_size) == 0) { @@ -39,7 +38,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) || (s->num_frames && (len + size) > s->max_payload_size)) { + if ((s->num_frames == s->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; |