summaryrefslogtreecommitdiff
path: root/libavformat/mux.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-15 20:04:52 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-16 13:49:02 +0100
commitcae11e40315ab871b502672fe459323266dd26cc (patch)
tree5b774ad99e5303b74464ecf33481860ac85b3312 /libavformat/mux.c
parent5c7e9e16c961f1f7258734426afac3cee4349580 (diff)
mux: fix chunked_duration rounding anomaly
a small value was rounded to 0 and then treated special as if chunked_duration was 0. This led to a inconsistency that further led to wrong interleaving Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mux.c')
-rw-r--r--libavformat/mux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 649b4961d9..ae5e6918c1 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -551,7 +551,7 @@ int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
if (*next_point) {
if (chunked) {
- uint64_t max= av_rescale_q(s->max_chunk_duration, AV_TIME_BASE_Q, st->time_base);
+ uint64_t max= av_rescale_q_rnd(s->max_chunk_duration, AV_TIME_BASE_Q, st->time_base, AV_ROUND_UP);
if ( st->interleaver_chunk_size + pkt->size <= s->max_chunk_size-1U
&& st->interleaver_chunk_duration + pkt->duration <= max-1U) {
st->interleaver_chunk_size += pkt->size;