[FFmpeg-cvslog] avconv: set the encoding/decoding_needed flags earlier

Anton Khirnov git at videolan.org
Sun Jul 19 12:51:17 CEST 2015


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sun Jun 28 08:03:44 2015 +0200| [59245e0c5e10a849e67c632cccf4f677b2442e82] | committer: Anton Khirnov

avconv: set the encoding/decoding_needed flags earlier

This will be useful in the following commits.

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

 avconv.c     |    4 ----
 avconv_opt.c |   11 +++++++++++
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/avconv.c b/avconv.c
index a44267c..0394a86 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1774,10 +1774,6 @@ static int transcode_init(void)
                 goto dump_format;
             }
 
-            if (ist)
-                ist->decoding_needed = 1;
-            ost->encoding_needed = 1;
-
             set_encoder_id(output_files[ost->file_index], ost);
 
             /*
diff --git a/avconv_opt.c b/avconv_opt.c
index 74307bf..7adf051 100644
--- a/avconv_opt.c
+++ b/avconv_opt.c
@@ -1621,6 +1621,17 @@ loop_end:
     }
     av_dict_free(&unused_opts);
 
+    /* set the encoding/decoding_needed flags */
+    for (i = of->ost_index; i < nb_output_streams; i++) {
+        OutputStream *ost = output_streams[i];
+
+        ost->encoding_needed = !ost->stream_copy;
+        if (ost->encoding_needed && ost->source_index >= 0) {
+            InputStream *ist = input_streams[ost->source_index];
+            ist->decoding_needed = 1;
+        }
+    }
+
     /* check filename in case of an image number is expected */
     if (oc->oformat->flags & AVFMT_NEEDNUMBER) {
         if (!av_filename_number_test(oc->filename)) {



More information about the ffmpeg-cvslog mailing list