diff options
Diffstat (limited to 'demos/modules/gaudio/oscilloscope/gwinosc.c')
-rw-r--r-- | demos/modules/gaudio/oscilloscope/gwinosc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/demos/modules/gaudio/oscilloscope/gwinosc.c b/demos/modules/gaudio/oscilloscope/gwinosc.c index 21a83760..6b51232b 100644 --- a/demos/modules/gaudio/oscilloscope/gwinosc.c +++ b/demos/modules/gaudio/oscilloscope/gwinosc.c @@ -96,7 +96,7 @@ GHandle gwinGScopeCreate(GDisplay *g, GScopeObject *gs, GWindowInit *pInit, uint void gwinScopeWaitForTrace(GHandle gh) { #define gs ((GScopeObject *)(gh)) - GAudioData *paud; + GDataBuffer *paud; int i; coord_t x, y; coord_t yoffset; @@ -144,10 +144,10 @@ void gwinScopeWaitForTrace(GHandle gh) { scopemin = 0; #endif - for(i = paud->len/(gfxSampleFormatBits(gs->format)/8); i; i--) { + for(i = paud->len/((gfxSampleFormatBits(gs->format)+7)/8); i; i--) { /* Calculate the new scope value - re-scale using simple shifts for efficiency, re-center and y-invert */ - if (gs->format <= 8) + if (gfxSampleFormatBits(gs->format) <= 8) y = yoffset - (((coord_t)(*pa8++ ) << shr) >> (16-SCOPE_Y_BITS)); else y = yoffset - (((coord_t)(*pa16++) << shr) >> (16-SCOPE_Y_BITS)); @@ -216,6 +216,6 @@ void gwinScopeWaitForTrace(GHandle gh) { gs->scopemin = scopemin; #endif - gaudioReleaseBuffer(paud); + gfxBufferRelease(paud); #undef gs } |