[PD-dev] help-array crashing outlet_anything

nosehair911 at bellsouth.net nosehair911 at bellsouth.net
Thu Jul 26 03:57:53 CEST 2007


SOLVED.(somewhat)
Instead of using the addToArray function I just used something like this:

Intstore *storepointer;

In my function I used this:

storepointer = new Intstore[anumber]; 

for (i=0; i<anumber; i++) {
storepointer[i].m_xmax = (whatever int);
storepointer[i].m_ymax = (whatever int);
}

So to send it out an outlet I do this:

t_atom*ap = new t_atom[2+anumber*2];
for(bn=0; bn<anumber; bn++){
		SETFLOAT(ap+bn*2, x->storepointer[bn].xmax());
		SETFLOAT(ap+bn*2+1, x->storepointer[bn].ymax());
}
outlet_anything(x->outlet1, 2+anumber*2, ap);

...and it works now. Simple and without too much hassle.
I still dont understand why it worked before but only with quicktime movies!  Makes no cense at all?
Alain

> From: <nosehair911 at bellsouth.net>
> Date: 2007/07/25 Wed PM 08:08:35 EDT
> To: <pd-dev at iem.at>
> Subject: Re: [PD-dev] help-array crashing outlet_anything
> 
> Ok I tried with a static array like "Class array[amount] " and it did not crash, it worked perfect. Now I 
> have to figure out what I am doing to cause a crash (with heavy cpu load I persume, still a bit 
> confused?) using a dynamic array? It would be nice to have a dynamic array so as not to eat up so 
> much ram.
> Alain
> > 
> > From: <nosehair911 at bellsouth.net>
> > Date: 2007/07/25 Wed PM 03:35:33 EDT
> > To: "chris clepper" <cgclepper at gmail.com>
> > CC: pd-dev at iem.at
> > Subject: Re: [PD-dev] help-array crashing outlet_anything
> > 
> > It doesn't thats whats confusing me.  Pixel data is the same on both exept it takes more cpu to 
> > process. I think it has to do with cpu load but I am not sure.  I think I am going to just try a simple 
> > "Class array[amount] " intead of "Class *pointer = new Class[amount]" see if that would be easier 
on 
> > the cpu or the coding gods.
> > 
> > Alain
> > 
> > > 
> > > From: "chris clepper" <cgclepper at gmail.com>
> > > Date: 2007/07/25 Wed PM 01:04:52 EDT
> > > To: "nosehair911 at bellsouth.net" <nosehair911 at bellsouth.net>
> > > CC: pd-dev at iem.at
> > > Subject: Re: [PD-dev] help-array crashing outlet_anything
> > > 
> > > On 7/25/07, nosehair911 at bellsouth.net <nosehair911 at bellsouth.net> wrote:
> > > >
> > > >
> > > > BTW its a blobtracking external.  It is working perfect tracking quicktime
> > > > movies but the camera
> > > > tracking only works if I exclude the addToArray function. This really has
> > > > me scratching my head!
> > > 
> > > 
> > > Why would your processing code know or even care if the input is from a
> > > camera or a file?  Both should be pixel arrays with no differences in their
> > > format.
> > > 
> > > 
> > 
> > 
> > _______________________________________________
> > PD-dev mailing list
> > PD-dev at iem.at
> > http://lists.puredata.info/listinfo/pd-dev
> > 
> 
> 
> _______________________________________________
> PD-dev mailing list
> PD-dev at iem.at
> http://lists.puredata.info/listinfo/pd-dev
> 





More information about the Pd-dev mailing list