From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@cse.psu.edu Subject: Re: [9fans] An acid-question From: "Sascha Retzki" Date: Sat, 15 Jul 2006 14:36:58 +0200 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 80bb1610-ead1-11e9-9d60-3106f5b1d025 > your loop test has an obiwan error: > > for(i=0;i <= inbyterate;i++) { > > should be > for(i = 0; i < inbyterate; i++); > heh.. 'oups' ;) .. Thanks Erik. Nevertheless, that is not the problem. Do you have an idea why acid does not 'see' i ? Or how I can investigate i? > - erik > > On Sat Jul 15 06:42:57 CDT 2006, sretzki@gmx.de wrote: >> Okay, I will never write pseudo-like code to demonstrate what I mean :/ >> >> fmt is a structure holding all meta-data of the audio-input. convertchannels() is called by a function which reads fmt->byterate audio-data from stdin, and provides another array big enough to hold a copy of the input-data (datacopy). >> >> void >> convertchannels(short *data, short *datacopy) >> { >> int i, j = 0; >> int inbyterate = fmt->samplerate * fmt->channels * 2; >> >> >> memcpy(datacopy,data,inbyterate * sizeof(short)); >> >> >> if(fmt->channels == 1) { >> >> for(i=0;i <= inbyterate;i++) { >> >> /* mono to left ... */ >> data[j++] = datacopy[i]; >> >> /* mono to right ... */ >> data[j++] = datacopy[i]; >> >> } >> } >> else >> sysfatal("convertchannels(): I can just convert from mono to stereo :-/\n");