From ca221635e9514fce1a3c7348ffcf3d3b0bf09814 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Mon, 19 Jul 2021 10:37:01 +0900 Subject: [PATCH] minor fixes --- lib/model/panorama.dart | 6 +----- lib/utils/constants.dart | 6 +++--- lib/widgets/viewer/video/fijkplayer.dart | 11 ++++++++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/model/panorama.dart b/lib/model/panorama.dart index df67ae060..f798c7cf1 100644 --- a/lib/model/panorama.dart +++ b/lib/model/panorama.dart @@ -22,13 +22,9 @@ class PanoramaInfo { final projectionType = map['projectionType'] as String?; // handle missing `fullPanoHeight` (e.g. Samsung camera app panorama mode) - if (fHeight == null && cWidth != null && cHeight != null) { - // assume the cropped area is actually covering 360 degrees horizontally - // even when `croppedAreaLeft` is non zero - fWidth = cWidth; + if (fHeight == null && fWidth != null && cHeight != null) { fHeight = (fWidth / 2).round(); cTop = ((fHeight - cHeight) / 2).round(); - cLeft = 0; } Rect? croppedAreaRect; diff --git a/lib/utils/constants.dart b/lib/utils/constants.dart index 7034249ac..583c64f86 100644 --- a/lib/utils/constants.dart +++ b/lib/utils/constants.dart @@ -279,10 +279,10 @@ class Constants { sourceUrl: 'https://github.com/dart-lang/intl', ), Dependency( - name: 'LatLong', + name: 'LatLong2', license: 'Apache 2.0', - licenseUrl: 'https://github.com/MikeMitterer/dart-latlong/blob/master/LICENSE', - sourceUrl: 'https://github.com/MikeMitterer/dart-latlong', + licenseUrl: 'https://github.com/jifalops/dart-latlong/blob/master/LICENSE', + sourceUrl: 'https://github.com/jifalops/dart-latlong', ), Dependency( name: 'PDF for Dart and Flutter', diff --git a/lib/widgets/viewer/video/fijkplayer.dart b/lib/widgets/viewer/video/fijkplayer.dart index 1eea6a26f..ee8776ca6 100644 --- a/lib/widgets/viewer/video/fijkplayer.dart +++ b/lib/widgets/viewer/video/fijkplayer.dart @@ -213,18 +213,23 @@ class IjkPlayerAvesVideoController extends AvesVideoController { allStreams.forEach((stream) { final type = ExtraStreamType.fromTypeString(stream[Keys.streamType]); if (type != null) { + final width = stream[Keys.width] as int?; + final height = stream[Keys.height] as int?; _streams.add(StreamSummary( type: type, index: stream[Keys.index], codecName: stream[Keys.codecName], language: stream[Keys.language], title: stream[Keys.title], - width: stream[Keys.width] as int?, - height: stream[Keys.height] as int?, + width: width, + height: height, )); switch (type) { case StreamType.video: - videoStreamCount++; + // check width/height to exclude image streams (that are included among video streams) + if (width != null && height != null) { + videoStreamCount++; + } break; case StreamType.audio: audioStreamCount++;