Skip to content

Commit 16fcd26

Browse files
committed
Merge branch 'development'
2 parents b41e114 + 8f7ed50 commit 16fcd26

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

OpenTimelineIO-Sample/OpenTimelineIO-Reader/Views/TimelineView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
{

Sources/OpenTimelineIO-AVFoundation/AVFoundation-Extensions/AVComposition.swift

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)