File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
OpenTimelineIO-Sample/OpenTimelineIO-Reader/Views
Sources/OpenTimelineIO-AVFoundation/AVFoundation-Extensions Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ struct TimelineView : View {
1818 @Binding var secondsToPixels : Double
1919 @Binding var selectedItem : Item ?
2020
21- @State private var hitTestEnabled : Bool = false
21+ @State private var hitTestEnabled : Bool = true
2222
2323 var body : some View
2424 {
Original file line number Diff line number Diff line change @@ -32,7 +32,24 @@ public extension AVComposition
3232 {
3333 print ( " Making Timeline from Composition " , self )
3434
35- let timeline = Timeline ( name: name, globalStartTime: config. globalStartTime )
35+ // Today OTIO has no way of describing frame rates
36+ // So some integrations presume the rate of the global start time
37+ // implies the frame rate of the sequence or project
38+
39+ let maxNominalFrameRate = self . tracks ( withMediaType: . video) . reduce ( Float . zero) { max ( $0, $1. nominalFrameRate) }
40+
41+ let globalStartTime : RationalTime
42+
43+ if maxNominalFrameRate != . zero
44+ {
45+ globalStartTime = config. globalStartTime. rescaled ( to: Double ( maxNominalFrameRate) )
46+ }
47+ else
48+ {
49+ globalStartTime = config. globalStartTime
50+ }
51+
52+ let timeline = Timeline ( name: name, globalStartTime: globalStartTime )
3653
3754 let all_tracks : [ Track ] = try self . tracks. compactMap { try $0. toOTIOTrack ( config: config) }
3855
You can’t perform that action at this time.
0 commit comments