MIX_DestroyAudioDecoder(3)

πŸ“¦
version 3.2.4 Β· 2 versions
, in fedora 44

πŸ’– MIX_DestroyAudioDecoder πŸ’–

okay so bestie, we're in the SDL_mixer3 FUNCTIONS section of the manual (that's the MIX_DestroyAudioDecoder(3) page, mwah) and it's literally the simplest little function ever. it destroys an audio decoder. that's it. that's the whole job. clean, minimal, iconic. πŸŽ€


✨ NAME ✨

MIX_DestroyAudioDecoder β€” Destroy the specified audio decoder. πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3_mixer/SDL_mixer.h>

void MIX_DestroyAudioDecoder(MIX_AudioDecoder *audiodecoder);

no return value, no drama, no notes. it takes your decoder and it's gone. periodt. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea πŸ“: you call this and the MIX_AudioDecoder you hand it gets destroyed, bye bye, no cap.

and the part that makes this genuinely lowkey the best: destroying a NULL MIX_AudioDecoder is a legal no-op. fr fr!! you don't have to check for NULL first, you don't have to wrap it in an if, you can just yeet it in there and the function is like "ok πŸ’– nothing to do, we move." that's main character energy of a cleanup function and i'm obsessed. πŸ‘‘


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • audiodecoder β€” the audio to destroy. give it the decoder you want gone and it handles it. (and remember, if it's NULL, it's a completely legal no-op, so no stress bestie 🫢)

⭐ THREAD SAFETY ⭐

It is safe to call this function from any thread. 🌈

like. any thread. every thread. your thread, her thread, that one background thread you forgot you spawned. it's all good, no locks required on your end, situation's handled. πŸ’…βœ¨


🌈 AVAILABILITY 🌈

This function is available since SDL_mixer 3.0.0. so if you're on 3.0.0 or later, you're golden ⭐ and if you're not… bestie. upgrade. 😭


⚠️ tiny reminder: it's NULL-safe, but you still shouldn't go using the pointer after you destroy it. freed is freed, iykyk. πŸ’€

okay that's the whole page, you ate it, you understood it, we're so proud πŸ’– this has been MIX_DestroyAudioDecoder(3), brought to you by SDL_mixer, version SDL_mixer 3.2.4. mwah, go destroy some decoders responsibly, queen πŸ‘‘πŸ¦‹βœ¨

πŸ“¦ where this page comes from