Merge pull request #617 from vector-im/feature/fga/fix_media_pre_processing
Feature/fga/fix media pre processing
This commit is contained in:
commit
c7b2ac5acd
25 changed files with 296 additions and 214 deletions
|
|
@ -20,5 +20,9 @@ import android.media.MediaMetadataRetriever
|
|||
|
||||
/** [MediaMetadataRetriever] only implements `AutoClosable` since API 29, so we need to execute this to have the same in older APIs. */
|
||||
inline fun <T> MediaMetadataRetriever.runAndRelease(block: MediaMetadataRetriever.() -> T): T {
|
||||
return block().also { release() }
|
||||
return try {
|
||||
block()
|
||||
} finally {
|
||||
release()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue