Author Topic: Setting position in STREAMPROC  (Read 280 times)

Blink123123

  • Posts: 28
Setting position in STREAMPROC
« on: 8 Apr '19 - 18:52 »
Hello,

I am implementing my own custom buffer, and for my purposes I need to update the position every-time STREAMPROC is called.
However most of the time the SetPosition is called for the current position.
So my question is should I make a check to see if the current position is the same and therefore skip calling SetPosition to save performance, or does it by default do that check, or it is not even worth it?

Ian @ un4seen

  • Administrator
  • Posts: 21979
Re: Setting position in STREAMPROC
« Reply #1 on: 9 Apr '19 - 17:56 »
BASS_ChannelSetPosition doesn't check if the requested position is the same as the current position. There may be times when you don't want to change position but still reset other things in the decoder. If you do check the position with BASS_ChannelGetPosition first, and it isn't a decoding channel, you should probably use the BASS_POS_DECODE flag in that call to get the decoder's position (not playback position).