diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-26 03:13:38 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-26 03:13:38 +0200 |
commit | 32cde962969363bebc4ad49b770ffff39487d3f8 (patch) | |
tree | 1ba606d41dbf6e49aa0902a4d5042b1881b48f37 /libavformat/mpegenc.c | |
parent | 930406325c2973b02b5bb0dc28e09947bea84053 (diff) | |
download | ffmpeg-32cde962969363bebc4ad49b770ffff39487d3f8.tar.gz |
avformat/mpegenc: Better heuristic for ordering packets
This prevents underflows in quite constrained cases
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpegenc.c')
-rw-r--r-- | libavformat/mpegenc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c index 47a7cedfe1..811fe2d9c3 100644 --- a/libavformat/mpegenc.c +++ b/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; |