File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Sources/OpenTimelineIO-AVFoundation/OpenTimelineIO-Extensions Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -81,8 +81,23 @@ extension ExternalReference
8181 return self . tryLoadAssetAtResolvedURL ( url: sourceURL)
8282 }
8383 }
84+
85+ // edge case -
86+ // if a OTIO file was packaged with media but paths werent linked, we should check CWD for the file
87+ // as a last case attempt.
88+ if let filename = path. components ( separatedBy: " / " ) . last
89+ {
90+ let newFileURL = baseURL. appending ( component: filename)
91+
92+ return self . tryLoadAssetAtResolvedURL ( url: newFileURL)
93+ }
94+
95+
8496 }
8597
98+
99+
100+
86101 let missingMediaURL = Bundle . main. url ( forResource: " MediaNotFound " , withExtension: " mp4 " ) !
87102
88103 return AVURLAsset ( url: missingMediaURL)
@@ -122,12 +137,12 @@ extension ExternalReference
122137
123138 if supported
124139 {
125- return AVURLAsset ( url: url)
140+ return AVURLAsset ( url: url, options : [ AVURLAssetPreferPreciseDurationAndTimingKey : true ] )
126141 }
127142
128143 let notSupportedMedia = Bundle . main. url ( forResource: " MediaNotSupported " , withExtension: " mp4 " ) !
129144
130- return AVURLAsset ( url: notSupportedMedia)
145+ return AVURLAsset ( url: notSupportedMedia, options : [ AVURLAssetPreferPreciseDurationAndTimingKey : true ] )
131146
132147 }
133148
You can’t perform that action at this time.
0 commit comments