MIX_DestroyAudioDecoder(3)
π 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'sNULL, 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
- fedora 44: SDL3_mixer-doc 3.2.4-3.fc44 Β· Zlib AND (GPL-2.0-or-later OR LGPL-2.0-or-later)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms