Fix MediaPreProcessor for images/videos sent as file
This commit is contained in:
parent
2cc78fd5fb
commit
33c74fb4e5
7 changed files with 251 additions and 147 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