From 99fb79b55ad9e6be52c16f2fd794f350bd76154a Mon Sep 17 00:00:00 2001 From: Baptiste Coudurier Date: Fri, 1 Feb 2008 13:08:04 +0000 Subject: [PATCH] Do not print quality when stream copy, Silence valgrind complaint: ==14746== Conditional jump or move depends on uninitialised value(s) ==14746== at 0x43488DF: (within /lib/i686/cmov/libc-2.7.so) ==14746== by 0x434ED81: __printf_fp (in /lib/i686/cmov/libc-2.7.so) ==14746== by 0x434A3F3: vfprintf (in /lib/i686/cmov/libc-2.7.so) ==14746== by 0x436EA93: vsnprintf (in /lib/i686/cmov/libc-2.7.so) ==14746== by 0x4353234: snprintf (in /lib/i686/cmov/libc-2.7.so) ==14746== by 0x806247C: print_report (ffmpeg.c:963) Originally committed as revision 11728 to svn://svn.ffmpeg.org/ffmpeg/trunk --- ffmpeg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ffmpeg.c b/ffmpeg.c index 555abe03f2..3b2814a688 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -954,7 +954,8 @@ static void print_report(AVFormatContext **output_files, enc = ost->st->codec; if (vid && enc->codec_type == CODEC_TYPE_VIDEO) { snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "q=%2.1f ", - enc->coded_frame->quality/(float)FF_QP2LAMBDA); + enc->coded_frame && !ost->st->stream_copy ? + enc->coded_frame->quality/(float)FF_QP2LAMBDA : -1); } if (!vid && enc->codec_type == CODEC_TYPE_VIDEO) { float t = (av_gettime()-timer_start) / 1000000.0; @@ -962,7 +963,8 @@ static void print_report(AVFormatContext **output_files, frame_number = ost->frame_number; snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "frame=%5d fps=%3d q=%3.1f ", frame_number, (t>1)?(int)(frame_number/t+0.5) : 0, - enc->coded_frame ? enc->coded_frame->quality/(float)FF_QP2LAMBDA : -1); + enc->coded_frame && !ost->st->stream_copy ? + enc->coded_frame->quality/(float)FF_QP2LAMBDA : -1); if(is_last_report) snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "L"); if(qp_hist && enc->coded_frame){