avformat/mpegenc: Better heuristic for ordering packets

This prevents underflows in quite constrained cases

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/36/merge
Michael Niedermayer 11 years ago
parent 930406325c
commit 32cde96296
  1. 4
      libavformat/mpegenc.c

@ -955,7 +955,9 @@ retry:
if(next_pkt && next_pkt->dts - scr > max_delay)
continue;
if ( stream->predecode_packet
&& stream->predecode_packet->size > stream->buffer_index)
rel_space += 1<<28;
if(rel_space > best_score){
best_score= rel_space;
best_i = i;

Loading…
Cancel
Save