]> granicus.if.org Git - libx264/commitdiff
Only print weightp stats if there were P-frames
authorFiona Glaser <fiona@x264.com>
Fri, 20 Nov 2009 16:04:28 +0000 (08:04 -0800)
committerFiona Glaser <fiona@x264.com>
Sat, 21 Nov 2009 19:48:26 +0000 (11:48 -0800)
encoder/encoder.c

index 1fc1c7a5cf8efd7fe9472c66f94ab39920553429..407e4f47773602b94b5f25faf077d7777e3357b4 100644 (file)
@@ -2566,7 +2566,7 @@ void    x264_encoder_close  ( x264_t *h )
                           fixed_pred_modes[i][8] * 100.0 / sum_pred_modes[i] );
         }
 
-        if( h->param.analyse.i_weighted_pred == X264_WEIGHTP_SMART )
+        if( h->param.analyse.i_weighted_pred == X264_WEIGHTP_SMART && h->stat.i_frame_count[SLICE_TYPE_P] > 0 )
             x264_log( h, X264_LOG_INFO, "Weighted P-Frames: Y:%.1f%%\n",
                       h->stat.i_wpred[0] * 100.0 / h->stat.i_frame_count[SLICE_TYPE_P] );