aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rtpenc_amr.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-01 01:31:45 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-01 01:31:49 +0100
commit5cb6b53050e39ed3cf7dabcf3cd8198a934f9bd2 (patch)
treefd71fe492208b02db3eb5d3cf615e6a5ddbd6ed2 /libavformat/rtpenc_amr.c
parent78c59f3f0c9f20c3d143bd75fdf125bdf032b16d (diff)
parent4f6cd883f06f7893a2b60a41e7a4f8ae633dac2f (diff)
downloadffmpeg-5cb6b53050e39ed3cf7dabcf3cd8198a934f9bd2.tar.gz
Merge commit '4f6cd883f06f7893a2b60a41e7a4f8ae633dac2f'
* commit '4f6cd883f06f7893a2b60a41e7a4f8ae633dac2f': rtpenc: Don't set max_frames_per_packet based on the packet frame size or frame rate Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtpenc_amr.c')
-rw-r--r--libavformat/rtpenc_amr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/rtpenc_amr.c b/libavformat/rtpenc_amr.c
index 08b614dd4d..8df5a3cf3e 100644
--- a/libavformat/rtpenc_amr.c
+++ b/libavformat/rtpenc_amr.c
@@ -30,6 +30,7 @@
void ff_rtp_send_amr(AVFormatContext *s1, const uint8_t *buff, int size)
{
RTPMuxContext *s = s1->priv_data;
+ AVStream *st = s1->streams[0];
int max_header_toc_size = 1 + s->max_frames_per_packet;
uint8_t *p;
int len;
@@ -38,7 +39,9 @@ void ff_rtp_send_amr(AVFormatContext *s1, const uint8_t *buff, int size)
len = s->buf_ptr - s->buf;
if (s->num_frames &&
(s->num_frames == s->max_frames_per_packet ||
- len + size - 1 > s->max_payload_size)) {
+ len + size - 1 > s->max_payload_size ||
+ av_compare_ts(s->cur_timestamp - s->timestamp, st->time_base,
+ s1->max_delay, AV_TIME_BASE_Q) >= 0)) {
int header_size = s->num_frames + 1;
p = s->buf + max_header_toc_size - header_size;
if (p != s->buf)