diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-01 01:31:45 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-01 01:31:49 +0100 |
commit | 5cb6b53050e39ed3cf7dabcf3cd8198a934f9bd2 (patch) | |
tree | fd71fe492208b02db3eb5d3cf615e6a5ddbd6ed2 /libavformat/rtpenc_xiph.c | |
parent | 78c59f3f0c9f20c3d143bd75fdf125bdf032b16d (diff) | |
parent | 4f6cd883f06f7893a2b60a41e7a4f8ae633dac2f (diff) | |
download | ffmpeg-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_xiph.c')
-rw-r--r-- | libavformat/rtpenc_xiph.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/rtpenc_xiph.c b/libavformat/rtpenc_xiph.c index 7572b176be..b4d950b91d 100644 --- a/libavformat/rtpenc_xiph.c +++ b/libavformat/rtpenc_xiph.c @@ -33,6 +33,7 @@ void ff_rtp_send_xiph(AVFormatContext *s1, const uint8_t *buff, int size) { RTPMuxContext *s = s1->priv_data; + AVStream *st = s1->streams[0]; int max_pkt_size, xdt, frag; uint8_t *q; @@ -78,8 +79,10 @@ void ff_rtp_send_xiph(AVFormatContext *s1, const uint8_t *buff, int size) av_assert1(s->num_frames <= s->max_frames_per_packet); if (s->num_frames > 0 && (remaining < 0 || - s->num_frames == s->max_frames_per_packet)) { - // send previous packets now; no room for new data + s->num_frames == s->max_frames_per_packet || + av_compare_ts(s->cur_timestamp - s->timestamp, st->time_base, + s1->max_delay, AV_TIME_BASE_Q) >= 0)) { + // send previous packets now; no room for new data, or too much delay ff_rtp_send_data(s1, s->buf, s->buf_ptr - s->buf, 0); s->num_frames = 0; } |