π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob][photos] Fix bug in parsing rotation metadata from video using FFProbe
ashilknaf5e9b51e19e
diff --git a/mobile/lib/models/ffmpeg/ffprobe_keys.dart b/mobile/lib/models/ffmpeg/ffprobe_keys.dartindex 5eddee32c8..55c26c29f1 100644--- a/mobile/lib/models/ffmpeg/ffprobe_keys.dart+++ b/mobile/lib/models/ffmpeg/ffprobe_keys.dart@@ -72,6 +72,7 @@ class FFProbeKeys {static const xiaomiSlowMoment = 'com.xiaomi.slow_moment';static const sideDataList = 'side_data_list';static const rotation = 'rotation';+ static const sideDataType = 'side_data_type';}class MediaStreamTypes {@@ -83,3 +84,16 @@ class MediaStreamTypes {static const unknown = 'unknown';static const video = 'video';}++enum SideDataType {+ displayMatrix;++ getString() {+ switch (this) {+ case SideDataType.displayMatrix:+ return 'Display Matrix';+ default:+ assert(false, 'Unknown side data type: $this');+ }+ }+}diff --git a/mobile/lib/models/ffmpeg/ffprobe_props.dart b/mobile/lib/models/ffmpeg/ffprobe_props.dartindex b72c59f5ba..28a92869d1 100644--- a/mobile/lib/models/ffmpeg/ffprobe_props.dart+++ b/mobile/lib/models/ffmpeg/ffprobe_props.dart@@ -174,7 +174,12 @@ class FFProbeProps {result._codecHeight = stream[key].toString();parsedData[key] = result._codecHeight;} else if (key == FFProbeKeys.sideDataList) {- result._rotation = stream[key][0][FFProbeKeys.rotation];+ for (Map sideData in stream[key]) {+ if (sideData[FFProbeKeys.sideDataType] ==+ SideDataType.displayMatrix.getString()) {+ result._rotation = sideData[FFProbeKeys.rotation];+ }+ }}}}