ref: 77cf9edad492cd627ff2818ca449eeaff520ad5d
parent: 6fa8563244804f153290a5f89eb31823601e0f5e
author: Jean-Marc Valin <[email protected]>
date: Fri Dec 4 09:40:50 EST 2015
opus_demo: fixes potential division by zero on files with no active frame
--- a/src/opus_demo.c
+++ b/src/opus_demo.c
@@ -866,7 +866,7 @@
1e-3*bits_max*sampling_rate/frame_size);
if (!decode_only)
fprintf (stderr, "active bitrate: %7.3f kb/s\n",
- 1e-3*bits_act*sampling_rate/(frame_size*(double)count_act));
+ 1e-3*bits_act*sampling_rate/(1e-15+frame_size*(double)count_act));
fprintf (stderr, "bitrate standard deviation: %7.3f kb/s\n",
1e-3*sqrt(bits2/count - bits*bits/(count*(double)count))*sampling_rate/frame_size);
/* Close any files to which intermediate results were stored */