aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-14 02:04:18 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-03-14 02:10:11 +0100
commit6968a7d1938cc009bad7a971f26d85ed271747ef (patch)
treeeb106dfbdfe9a7bc9d7fe53ead7b56c725d406fe /ffmpeg.c
parentc2e3b564b32d596f5a66d47409f9e07a067a3084 (diff)
parent972880f597d74673a04d3ea8540864ae715ce9a6 (diff)
downloadffmpeg-6968a7d1938cc009bad7a971f26d85ed271747ef.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: doc/general: update supported devices table. doc/general: add missing @tab to codecs table. h264: Fix invalid interlaced/progressive MB combinations for direct mode prediction. avconv: reindent avconv: link '-passlogfile' option to libx264 'stats' AVOption. libx264: add 'stats' private option for setting 2pass stats filename. libx264: fix help text for slice-max-size option. http: Clear the auth state on redirects http: Retry auth if it failed due to being stale rtsp: Resend new keepalive commands if they used stale auth rtsp: Retry authentication if failed due to being stale httpauth: Parse the stale field in digest auth dxva2_vc1: pass the overlap flag to the decoder dxva2_vc1: fix decoding of BI frames FATE: add shorthand to wavpack test dfa: convert to bytestream2 API anm decoder: move buffer allocation from decode_init() to decode_frame() h264: improve parsing of broken AVC SPS Conflicts: ffmpeg.c libavcodec/anm.c libavcodec/dfa.c libavcodec/h264.c libavcodec/h264_direct.c libavcodec/h264_ps.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c39
1 files changed, 21 insertions, 18 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 4714b616a7..0a2f055ba5 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2651,32 +2651,35 @@ static int transcode_init(OutputFile *output_files, int nb_output_files,
break;
}
/* two pass mode */
- if (codec->codec_id != CODEC_ID_H264 &&
- (codec->flags & (CODEC_FLAG_PASS1 | CODEC_FLAG_PASS2))) {
+ if (codec->flags & (CODEC_FLAG_PASS1 | CODEC_FLAG_PASS2)) {
char logfilename[1024];
FILE *f;
snprintf(logfilename, sizeof(logfilename), "%s-%d.log",
pass_logfilename_prefix ? pass_logfilename_prefix : DEFAULT_PASS_LOGFILENAME_PREFIX,
i);
- if (codec->flags & CODEC_FLAG_PASS2) {
- char *logbuffer;
- size_t logbuffer_size;
- if (cmdutils_read_file(logfilename, &logbuffer, &logbuffer_size) < 0) {
- av_log(NULL, AV_LOG_FATAL, "Error reading log file '%s' for pass-2 encoding\n",
- logfilename);
- exit_program(1);
+ if (!strcmp(ost->enc->name, "libx264")) {
+ av_dict_set(&ost->opts, "stats", logfilename, AV_DICT_DONT_OVERWRITE);
+ } else {
+ if (codec->flags & CODEC_FLAG_PASS2) {
+ char *logbuffer;
+ size_t logbuffer_size;
+ if (cmdutils_read_file(logfilename, &logbuffer, &logbuffer_size) < 0) {
+ av_log(NULL, AV_LOG_FATAL, "Error reading log file '%s' for pass-2 encoding\n",
+ logfilename);
+ exit_program(1);
+ }
+ codec->stats_in = logbuffer;
}
- codec->stats_in = logbuffer;
- }
- if (codec->flags & CODEC_FLAG_PASS1) {
- f = fopen(logfilename, "wb");
- if (!f) {
- av_log(NULL, AV_LOG_FATAL, "Cannot write log file '%s' for pass-1 encoding: %s\n",
- logfilename, strerror(errno));
- exit_program(1);
+ if (codec->flags & CODEC_FLAG_PASS1) {
+ f = fopen(logfilename, "wb");
+ if (!f) {
+ av_log(NULL, AV_LOG_FATAL, "Cannot write log file '%s' for pass-1 encoding: %s\n",
+ logfilename, strerror(errno));
+ exit_program(1);
+ }
+ ost->logfile = f;
}
- ost->logfile = f;
}
}
}