Fixed warning.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16824 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-03-18 12:36:34 +00:00
parent acfa924c01
commit be4691a9c1
+7 -10
View File
@@ -114,15 +114,13 @@ ScopeView::RenderLaunch(void *data)
void void
ScopeView::RenderLoop() ScopeView::RenderLoop()
{ {
while (!fQuitting) { while (!fQuitting) {
if (acquire_sem(fRenderSem)!=B_OK) if (acquire_sem(fRenderSem)!=B_OK)
continue; continue;
fIsRendering = true; fIsRendering = true;
int32 frame_size = (fPlayFormat.u.raw_audio.format & 0xf) * fPlayFormat.u.raw_audio.channel_count; //int32 frameSize = (fPlayFormat.u.raw_audio.format & 0xf) * fPlayFormat.u.raw_audio.channel_count;
int64 totalFrames = fMediaTrack->CountFrames(); int64 totalFrames = fMediaTrack->CountFrames();
int16 samples[fPlayFormat.u.raw_audio.buffer_size / (fPlayFormat.u.raw_audio.format & 0xf)]; int16 samples[fPlayFormat.u.raw_audio.buffer_size / (fPlayFormat.u.raw_audio.format & 0xf)];
int64 frames = 0; int64 frames = 0;
@@ -130,17 +128,16 @@ ScopeView::RenderLoop()
int64 framesIndex = 0; int64 framesIndex = 0;
int32 sumCount = 0; int32 sumCount = 0;
fMediaTrack->SeekToFrame(&frames); fMediaTrack->SeekToFrame(&frames);
TRACE("begin computing\n"); TRACE("begin computing\n");
int32 previewIndex = 0; int32 previewIndex = 0;
while (fMediaTrack->ReadFrames(samples, &frames) == B_OK) { while (fMediaTrack->ReadFrames(samples, &frames) == B_OK) {
//TRACE("reading block\n"); //TRACE("reading block\n");
framesIndex = 0; framesIndex = 0;
while (framesIndex < frames) { while (framesIndex < frames) {
for (; framesIndex < frames && sumCount < totalFrames/20000; framesIndex++, sumCount++) { for (; framesIndex < frames && sumCount < totalFrames/20000; framesIndex++, sumCount++) {
sum += samples[2*framesIndex]; sum += samples[2*framesIndex];
sum += samples[2*framesIndex+1]; sum += samples[2*framesIndex+1];