diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2015-12-04 14:40:50 -0500 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2015-12-04 14:40:50 -0500 |
commit | 77cf9edad492cd627ff2818ca449eeaff520ad5d (patch) | |
tree | 409ff2c6845b71342e0312c2a8aeba475af72626 | |
parent | 6fa8563244804f153290a5f89eb31823601e0f5e (diff) | |
download | opus-77cf9edad492cd627ff2818ca449eeaff520ad5d.tar.gz |
opus_demo: fixes potential division by zero on files with no active frame
-rw-r--r-- | src/opus_demo.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/opus_demo.c b/src/opus_demo.c index 173ec517..9e99a3b2 100644 --- a/src/opus_demo.c +++ b/src/opus_demo.c @@ -866,7 +866,7 @@ int main(int argc, char *argv[]) 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 */ |