mirror of https://github.com/odrling/Aegisub
Fixed division by zero (OSHI-) in audio display code.
Originally committed to SVN as r1795.
This commit is contained in:
parent
efc04d9e4c
commit
8ce9d53757
|
@ -101,6 +101,7 @@ AudioDisplay::AudioDisplay(wxWindow *parent)
|
||||||
provider = NULL;
|
provider = NULL;
|
||||||
player = NULL;
|
player = NULL;
|
||||||
hold = 0;
|
hold = 0;
|
||||||
|
samples = 0;
|
||||||
hasFocus = (wxWindow::FindFocus() == this);
|
hasFocus = (wxWindow::FindFocus() == this);
|
||||||
|
|
||||||
// Init
|
// Init
|
||||||
|
@ -1914,8 +1915,10 @@ void AudioDisplay::OnSize(wxSizeEvent &event) {
|
||||||
h -= Options.AsBool(_T("Audio Draw Timeline")) ? 20 : 0;
|
h -= Options.AsBool(_T("Audio Draw Timeline")) ? 20 : 0;
|
||||||
|
|
||||||
// Update image
|
// Update image
|
||||||
|
if (samples) {
|
||||||
UpdateSamples();
|
UpdateSamples();
|
||||||
UpdatePosition(PositionSample / samples);
|
UpdatePosition(PositionSample / samples);
|
||||||
|
}
|
||||||
UpdateImage();
|
UpdateImage();
|
||||||
|
|
||||||
// Update scrollbar
|
// Update scrollbar
|
||||||
|
|
Loading…
Reference in New Issue