X-Git-Url: https://git.nihav.org/?p=nihav-player.git;a=blobdiff_plain;f=sndplay%2Fsrc%2Fmain.rs;h=e1b8472886a93aab83ed46cecd65846b1d47d67b;hp=43f8fca879895f016df669541c16c4d15ced5986;hb=656062131be9a7cd314bbc6c165edad850afead2;hpb=36ac48e5c692d34bce560528426634c0d75c5c8b diff --git a/sndplay/src/main.rs b/sndplay/src/main.rs index 43f8fca..e1b8472 100644 --- a/sndplay/src/main.rs +++ b/sndplay/src/main.rs @@ -86,6 +86,12 @@ impl AudioDevice { } } +impl Drop for AudioDevice { + fn drop(&mut self) { + unsafe { sdl2_sys::SDL_CloseAudioDevice(self.device_id); } + } +} + struct Decoder<'a> { demuxer: Demuxer<'a>, decoder: Box,