summaryrefslogtreecommitdiff
path: root/libavformat/mux.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-15 23:56:37 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-17 14:45:30 +0100
commitc57c1329a9958c7eae1c9388fac673f0df53ae13 (patch)
treefa6b24129a122ce3505034340edb49a3ba1af01c /libavformat/mux.c
parent2dc9bcad7d57f70181ffa5c1804d1426afb50346 (diff)
mux: simplify chunking interleaver code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mux.c')
-rw-r--r--libavformat/mux.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c
index d93931518a..0648b3f8c0 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -551,11 +551,10 @@ int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
if (chunked) {
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;
- st->interleaver_chunk_duration += pkt->duration;
- } else {
+ st->interleaver_chunk_size += pkt->size;
+ st->interleaver_chunk_duration += pkt->duration;
+ if ( st->interleaver_chunk_size > s->max_chunk_size-1U
+ || st->interleaver_chunk_duration > max-1U) {
st->interleaver_chunk_size =
st->interleaver_chunk_duration = 0;
this_pktl->pkt.flags |= CHUNK_START;