projects
/
nihav-player.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
36ac48e
)
sndplayer: free audio device after playback is over
author
Kostya Shishkov
<kostya.shishkov@gmail.com>
Tue, 30 Mar 2021 10:19:24 +0000
(12:19 +0200)
committer
Kostya Shishkov
<kostya.shishkov@gmail.com>
Tue, 30 Mar 2021 10:19:24 +0000
(12:19 +0200)
sndplay/src/main.rs
patch
|
blob
|
blame
|
history
diff --git
a/sndplay/src/main.rs
b/sndplay/src/main.rs
index 43f8fca879895f016df669541c16c4d15ced5986..e1b8472886a93aab83ed46cecd65846b1d47d67b 100644
(file)
--- 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<dyn NADecoder>,