Author Topic: BASS_ChannelGetData improvement  (Read 1136 times)

3delite

  • Posts: 907
BASS_ChannelGetData improvement
« on: 10 Aug '10 - 22:40 »
Hi!

Many times we need to stream a channel's data for example to feed the data to BASSEnc.
We have to call BASS_ChannelGetData in a loop and the buffer gets filled over and over again though we don't need the data.
It came to my mind that could it be possible to optimize the logic for these cases?
For example a flag for BASS_ChannelGetData to not fill the buffer but still stream the data to DSP/BASSEnc?
I mean it would be faster/more optimized? Wouldn't it?

Best regards
3delite

Ian @ un4seen

  • Administrator
  • Posts: 20433
Re: BASS_ChannelGetData improvement
« Reply #1 on: 11 Aug '10 - 16:11 »
A buffer is needed to receive data from the decoder before it can be fed to DSP/etc, so I'm afraid it isn't possible to remove the buffer requirement. BASS_ChannelGetData could be modified to not require a buffer to be provided, but it would then have to allocate one itself internally, which would probably actually make performance worse due to the extra memory allocation calls. So not much point doing that :)

3delite

  • Posts: 907
Re: BASS_ChannelGetData improvement
« Reply #2 on: 11 Aug '10 - 20:26 »
Ok. I thought BASS is copying to the buffer from an existing buffer.

Best regards
3delite