minor fixes
This commit is contained in:
parent
e2b28a366e
commit
878b39605b
3 changed files with 14 additions and 8 deletions
|
@ -17,6 +17,7 @@ import deckers.thibault.aves.metadata.metadataextractor.SafeMp4UuidBoxHandler
|
|||
import deckers.thibault.aves.metadata.metadataextractor.SafeXmpReader
|
||||
import deckers.thibault.aves.utils.ContextUtils.queryContentResolverProp
|
||||
import deckers.thibault.aves.utils.LogUtils
|
||||
import deckers.thibault.aves.utils.MemoryUtils
|
||||
import deckers.thibault.aves.utils.MimeTypes
|
||||
import deckers.thibault.aves.utils.StorageUtils
|
||||
import org.mp4parser.IsoFile
|
||||
|
@ -150,12 +151,17 @@ object XMP {
|
|||
// creating `IsoFile` with a `File` or a `File.inputStream()` yields `No such device`
|
||||
IsoFile(channel, boxParser).use { isoFile ->
|
||||
isoFile.processBoxes(UserBox::class.java, true) { box, _ ->
|
||||
val bytes = box.toBytes()
|
||||
val payload = bytes.copyOfRange(8, bytes.size)
|
||||
val boxSize = box.size
|
||||
if (MemoryUtils.canAllocate(boxSize)) {
|
||||
val bytes = box.toBytes()
|
||||
val payload = bytes.copyOfRange(8, bytes.size)
|
||||
|
||||
val metadata = com.drew.metadata.Metadata()
|
||||
SafeMp4UuidBoxHandler(metadata).processBox("", payload, -1, null)
|
||||
processDirs(metadata.directories.filter { dir -> dir.tagCount > 0 }.toList())
|
||||
val metadata = com.drew.metadata.Metadata()
|
||||
SafeMp4UuidBoxHandler(metadata).processBox("", payload, -1, null)
|
||||
processDirs(metadata.directories.filter { dir -> dir.tagCount > 0 }.toList())
|
||||
} else {
|
||||
Log.w(LOG_TAG, "MP4 box too large at $boxSize bytes, for mimeType=$mimeType uri=$uri")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,14 +28,14 @@ class FixedExtentSectionLayout extends SectionLayout {
|
|||
@override
|
||||
int getMinChildIndexForScrollOffset(double scrollOffset) {
|
||||
scrollOffset -= bodyMinOffset;
|
||||
if (scrollOffset < 0) return firstIndex;
|
||||
if (scrollOffset < 0 || mainAxisStride == 0) return firstIndex;
|
||||
return bodyFirstIndex + scrollOffset ~/ mainAxisStride;
|
||||
}
|
||||
|
||||
@override
|
||||
int getMaxChildIndexForScrollOffset(double scrollOffset) {
|
||||
scrollOffset -= bodyMinOffset;
|
||||
if (scrollOffset < 0) return firstIndex;
|
||||
if (scrollOffset < 0 || mainAxisStride == 0) return firstIndex;
|
||||
return bodyFirstIndex + (scrollOffset / mainAxisStride).ceil() - 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -195,7 +195,7 @@ class _MagnifierCoreState extends State<MagnifierCore> with TickerProviderStateM
|
|||
const t = 0.2;
|
||||
final animationVelocity = (tween.end! - tween.begin!).distance * curve.transform(t) / t;
|
||||
final gestureVelocity = targetPixelPerSecond.distance;
|
||||
return Duration(milliseconds: (animationVelocity / gestureVelocity * 1000).round());
|
||||
return Duration(milliseconds: gestureVelocity != 0 ? (animationVelocity / gestureVelocity * 1000).round() : 0);
|
||||
}
|
||||
|
||||
void onTap(TapUpDetails details) {
|
||||
|
|
Loading…
Reference in a new issue