avformat/mpegenc: Better heuristic for ordering packets

This prevents underflows in quite constrained cases

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-09-26 03:13:38 +02:00
parent 930406325c
commit 32cde96296
1 changed files with 3 additions and 1 deletions

View File

@ -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;