From 887f305d37cef754d3a50104b9e312ce01e2815c Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Tue, 11 Oct 2005 10:09:47 +0000 Subject: fixes for Metrowerks fix compilation for CFM small fixes correction of limits on buffer resize svn path=/trunk/; revision=3692 --- externals/grill/xsample/source/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'externals/grill/xsample/source/main.cpp') diff --git a/externals/grill/xsample/source/main.cpp b/externals/grill/xsample/source/main.cpp index a948c056..df0c1456 100644 --- a/externals/grill/xsample/source/main.cpp +++ b/externals/grill/xsample/source/main.cpp @@ -167,8 +167,13 @@ void xsample::DoUpdate(unsigned int flags) buf.Set(); if(flags&xsc_range && buf.Ok()) { + const int f = buf.Frames(); + if(curmin < 0) curmin = 0; - if(curmax > buf.Frames()) curmax = buf.Frames(); + else if(curmin > f) curmin = f; + + if(curmax > f) curmax = f; + else if(curmax < curmin) curmax = curmin; } if(flags&xsc_units) { -- cgit v1.2.1