diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-01 01:00:40 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-01 01:00:44 +0100 |
commit | ba069e08bdaa431ed8198ac20d2e648de95bc664 (patch) | |
tree | f2f5a755489fdf34cccf143654f4e960a711fa5a /libavformat | |
parent | 6f0a82966d82a88bedab91c617df502c3855e9aa (diff) | |
parent | 0662440b991361fdb5e732712d997a73e4692e34 (diff) | |
download | ffmpeg-ba069e08bdaa431ed8198ac20d2e648de95bc664.tar.gz |
Merge commit '0662440b991361fdb5e732712d997a73e4692e34'
* commit '0662440b991361fdb5e732712d997a73e4692e34':
rtpenc_aac: Set a default value for max_frames_per_packet at init
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/rtpenc.c | 2 | ||||
-rw-r--r-- | libavformat/rtpenc_aac.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c index 969e09b00c..5fe712117f 100644 --- a/libavformat/rtpenc.c +++ b/libavformat/rtpenc.c @@ -274,6 +274,8 @@ static int rtp_write_header(AVFormatContext *s1) goto defaultcase; case AV_CODEC_ID_AAC: s->num_frames = 0; + if (!s->max_frames_per_packet) + s->max_frames_per_packet = 5; goto defaultcase; default: defaultcase: diff --git a/libavformat/rtpenc_aac.c b/libavformat/rtpenc_aac.c index 7f2621f5f9..5c85ff945a 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; |