minor fix

This commit is contained in:
Thibault Deckers 2025-03-16 18:29:09 +01:00
parent b8e9786f4d
commit 672b6fd2dc

View file

@ -541,6 +541,7 @@ class MetadataFetchHandler(private val context: Context) : MethodCallHandler {
// fallback to MP4 `loci` box for location // fallback to MP4 `loci` box for location
if (!metadataMap.contains(KEY_LATITUDE) || !metadataMap.contains(KEY_LONGITUDE)) { if (!metadataMap.contains(KEY_LATITUDE) || !metadataMap.contains(KEY_LONGITUDE)) {
try {
Mp4ParserHelper.getUserDataBox(context, mimeType, uri)?.let { userDataBox -> Mp4ParserHelper.getUserDataBox(context, mimeType, uri)?.let { userDataBox ->
Path.getPath<LocationInformationBox>(userDataBox, LocationInformationBox.TYPE)?.let { locationBox -> Path.getPath<LocationInformationBox>(userDataBox, LocationInformationBox.TYPE)?.let { locationBox ->
if (!locationBox.isParsed) { if (!locationBox.isParsed) {
@ -550,6 +551,9 @@ class MetadataFetchHandler(private val context: Context) : MethodCallHandler {
metadataMap[KEY_LONGITUDE] = locationBox.longitude metadataMap[KEY_LONGITUDE] = locationBox.longitude
} }
} }
} catch (e: Exception) {
Log.w(LOG_TAG, "failed to get Location Information box by MP4 parser for mimeType=$mimeType uri=$uri", e)
}
} }
} }