avconv: flush decoders immediately after an EOF.

Prevents extensive buffering when overlaying a single picture.
This commit is contained in:
Anton Khirnov 2012-04-02 20:13:29 +02:00
parent 89605e4aa0
commit 9e8aae443b
1 changed files with 8 additions and 1 deletions

View File

@ -3054,6 +3054,13 @@ static int transcode(void)
}
if (ret < 0) {
input_files[file_index]->eof_reached = 1;
for (i = 0; i < input_files[file_index]->nb_streams; i++) {
ist = input_streams[input_files[file_index]->ist_index + i];
if (ist->decoding_needed)
output_packet(ist, NULL);
}
if (opt_shortest)
break;
else
@ -3125,7 +3132,7 @@ static int transcode(void)
/* at the end of stream, we must flush the decoder buffers */
for (i = 0; i < nb_input_streams; i++) {
ist = input_streams[i];
if (ist->decoding_needed) {
if (!input_files[ist->file_index]->eof_reached && ist->decoding_needed) {
output_packet(ist, NULL);
}
}