Author Topic: Best practice for deleting chain of streams  (Read 199 times)

elan

  • Posts: 29
Best practice for deleting chain of streams
« on: 28 May '19 - 11:11 »
If I have a chain of streams which might look like:

  - mixer
  - stream 1 (stream proc, plugged into mixer, reads from stream 2)
  - stream 2 (resampler on stream 3)
  - stream 3 (FileUser stream)

What is best practice when I want to shut them down and delete them proactively (in terms of order and APIs)?

Thanks!

Ian @ un4seen

  • Administrator
  • Posts: 21979
Re: Best practice for deleting chain of streams
« Reply #1 on: 28 May '19 - 16:29 »
You would call BASS_StreamFree on each of the streams to free them (it won't really matter in what order you do that). You can avoid the need for the BASS_StreamFree calls on "stream 1" and "stream 3" by using the BASS_STREAM_AUTOFREE flag in their BASS_Mixer_StreamAddChannel calls.