* avoids some divisions by zero
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31765 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -120,6 +120,8 @@ void
|
||||
ScopeView::ComputeRendering()
|
||||
{
|
||||
int64 framesCount = fMediaTrack->CountFrames() / SAMPLES_COUNT;
|
||||
if (framesCount <= 0)
|
||||
return;
|
||||
T samples[fPlayFormat.u.raw_audio.buffer_size / (fPlayFormat.u.raw_audio.format
|
||||
& media_raw_audio_format::B_AUDIO_SIZE_MASK)];
|
||||
int64 frames = 0;
|
||||
@@ -160,6 +162,8 @@ ScopeView::ComputeRendering()
|
||||
}
|
||||
}
|
||||
|
||||
if (previewMax <= 0)
|
||||
return;
|
||||
for (int i = 0; i < SAMPLES_COUNT; i++)
|
||||
fPreview[i] = (int32)(fPreview[i] * 1.0 / previewMax * middle + middle);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user