Skip to content

Commit

Permalink
Release BufferFilter's when renderer is released (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
izzytwosheds committed Jul 1, 2022
1 parent c74f270 commit 409a707
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,6 @@ class VolumeFilter(@FloatRange(from = 0.0) private val volume: Double) : BufferF
}
}
}

override fun release() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ interface BufferFilter {
* sample rate and channel count.
*/
fun apply(frame: Frame)

/**
* Release the filter.
*/
fun release()
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class AudioRenderer @JvmOverloads constructor(
released.set(true)
audioProcessor?.release()
bufferPool.clear()
filters.forEach { it.release() }
}

override fun hasFilters(): Boolean {
Expand Down

0 comments on commit 409a707

Please sign in to comment.