[FFmpeg-cvslog] avconv: flush decoders immediately after an EOF.

Anton Khirnov git at videolan.org
Tue Apr 17 12:27:17 CEST 2012


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Mon Apr  2 20:13:29 2012 +0200| [9e8aae443b4b3f377ccb038a6444f4c33dc5dc78] | committer: Anton Khirnov

avconv: flush decoders immediately after an EOF.

Prevents extensive buffering when overlaying a single picture.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9e8aae443b4b3f377ccb038a6444f4c33dc5dc78
---

 avconv.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/avconv.c b/avconv.c
index a8824ef..347f804 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);
         }
     }



More information about the ffmpeg-cvslog mailing list