is it possibile to check the validity of a sync handle?

Started by MB_SOFT, 18 Jul '23 - 17:25

MB_SOFT

if i have an handle returned by BASS_ChannelSetSync can i check later if that handle is still opened or has been freed/removed?

i ask this because i don't want to accidentally create another sync if the previous one is still running.

Ian @ un4seen

There isn't currently any way to check whether a sync handle is valid, except using it in a BASS_ChannelRemoveSync call, but of course it won't be valid any more after that. Are you using ONETIME syncs? If not, the syncs shouldn't ever be freed automatically, so should stay valid until you free them (or the stream). If you are using a ONETIME sync then perhaps you could reset your sync handle variable to 0 in the SYNCPROC callback?

MB_SOFT

ok i will reset sync handle variable to 0 in the SYNCPROC callback, thak you