summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-04-06 21:17:32 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-04-06 23:21:44 +0200
commit6b1c886b6562eae7bab8cbbeb590478e34859bc7 (patch)
tree5272bb4b4c29d13feaf7e3bb77e7db0554cb6a75 /ffmpeg.c
parent1265395b5b1a6cde6549dabbb3820d343642f809 (diff)
Fix ticket20
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index dd1fb3e67e..e147363011 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1381,26 +1381,25 @@ static void print_report(AVFormatContext **output_files,
ti1 = 1e10;
vid = 0;
for(i=0;i<nb_ostreams;i++) {
+ float q= -1;
ost = ost_table[i];
enc = ost->st->codec;
+ if(!ost->st->stream_copy && enc->coded_frame)
+ q= enc->coded_frame->quality/(float)FF_QP2LAMBDA;
if (vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) {
- snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "q=%2.1f ",
- !ost->st->stream_copy ?
- enc->coded_frame->quality/(float)FF_QP2LAMBDA : -1);
+ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "q=%2.1f ", q);
}
if (!vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) {
float t = (av_gettime()-timer_start) / 1000000.0;
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,
- !ost->st->stream_copy ?
- enc->coded_frame->quality/(float)FF_QP2LAMBDA : -1);
+ frame_number, (t>1)?(int)(frame_number/t+0.5) : 0, q);
if(is_last_report)
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "L");
if(qp_hist){
int j;
- int qp= lrintf(enc->coded_frame->quality/(float)FF_QP2LAMBDA);
+ int qp= lrintf(q);
if(qp>=0 && qp<FF_ARRAY_ELEMS(qp_histogram))
qp_histogram[qp]++;
for(j=0; j<32; j++)