Merge master.
[dcpomatic.git] / src / wx / audio_plot.cc
index 7ed792351bb30e49ecbfa33fdb1ad12b72a3e286..0868d931a8be1d38dc7b95e0c154afce4e544a51 100644 (file)
@@ -145,8 +145,7 @@ AudioPlot::paint ()
        gc->SetPen (*wxLIGHT_GREY_PEN);
        gc->StrokePath (grid);
 
-       gc->DrawText (_("Time"), data_width, _height - _y_origin + db_label_height / 2);
-
+       gc->DrawText (_("DCPTime"), data_width, _height - _y_origin + db_label_height / 2);
        
        if (_type_visible[AudioPoint::PEAK]) {
                for (int c = 0; c < MAX_AUDIO_CHANNELS; ++c) {
@@ -260,7 +259,9 @@ AudioPlot::plot_rms (wxGraphicsPath& path, int channel) const
                        p += pow (*j, 2);
                }
 
-               p = sqrt (p / smoothing.size ());
+               if (smoothing.size() > 0) {
+                       p = sqrt (p / smoothing.size ());
+               }
 
                path.AddLineToPoint (_db_label_width + i * _x_scale, y_for_linear (p));
        }