aboutsummaryrefslogtreecommitdiffstats
path: root/avconv.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-04-02 20:13:29 +0200
committerAnton Khirnov <anton@khirnov.net>2012-04-15 20:37:47 +0200
commit9e8aae443b4b3f377ccb038a6444f4c33dc5dc78 (patch)
tree2147f294e73af7257dcd33e481666ed20d7a2975 /avconv.c
parent89605e4aa018f75fef1de531449383b0e9d1bfe1 (diff)
downloadffmpeg-9e8aae443b4b3f377ccb038a6444f4c33dc5dc78.tar.gz
avconv: flush decoders immediately after an EOF.
Prevents extensive buffering when overlaying a single picture.
Diffstat (limited to 'avconv.c')
-rw-r--r--avconv.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/avconv.c b/avconv.c
index a8824efff4..347f80493d 100644
--- a/avconv.c
+++ b/avconv.c
@@ -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);
}
}