avconv: link '-passlogfile' option to libx264 'stats' AVOption.

Message ID 20120314210240.9ABDA5E088@aruru.libav.org
State New
Headers show

Commit Message

Janne Grunau March 14, 2012, 9:02 p.m.
Module: libav
Branch: release/0.8
Commit: 666bd5848a92f82ee97ad0869dd1f8c7edb9f214

Author:    Anton Khirnov <anton@khirnov.net>
Committer: Reinhard Tartler <siretart@tauware.de>
Date:      Mon Mar 12 17:42:57 2012 +0100

avconv: link '-passlogfile' option to libx264 'stats' AVOption.

Fixes bug 204.

CC: libav-stable@libav.org
(cherry picked from commit 6e8be949f12734f38d360aad0f5c503a0f9606fa)

Signed-off-by: Reinhard Tartler <siretart@tauware.de>

---

 avconv.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Patch

diff --git a/avconv.c b/avconv.c
index 46f3090..4a61fa5 100644
--- a/avconv.c
+++ b/avconv.c
@@ -2459,6 +2459,9 @@  static int transcode_init(OutputFile *output_files,
                 snprintf(logfilename, sizeof(logfilename), "%s-%d.log",
                          pass_logfilename_prefix ? pass_logfilename_prefix : DEFAULT_PASS_LOGFILENAME_PREFIX,
                          i);
+                if (!strcmp(ost->enc->name, "libx264")) {
+                    av_dict_set(&ost->opts, "stats", logfilename, AV_DICT_DONT_OVERWRITE);
+                } else {
                 if (codec->flags & CODEC_FLAG_PASS1) {
                     f = fopen(logfilename, "wb");
                     if (!f) {
@@ -2477,6 +2480,7 @@  static int transcode_init(OutputFile *output_files,
                     }
                     codec->stats_in = logbuffer;
                 }
+                }
             }
         }
         if (codec->codec_type == AVMEDIA_TYPE_VIDEO) {