@omnimedia/omnitool 1.1.0-106 → 1.1.0-107

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnimedia/omnitool",
3
- "version": "1.1.0-106",
3
+ "version": "1.1.0-107",
4
4
  "description": "open source video processing tools",
5
5
  "license": "MIT",
6
6
  "author": "Przemysław Gałęzki",
@@ -17,14 +17,17 @@ export async function initStreams(
17
17
  return
18
18
  if (item.enabled === false)
19
19
  return
20
+ if (localTime >= item.duration)
21
+ return
20
22
 
21
23
  const sink = await pool.getSink(item.mediaHash)
22
24
  if (!sink)
23
25
  return
24
26
 
25
27
  const mediaTime = item.start + localTime
28
+ const mediaEnd = item.start + item.duration
26
29
  const offset = seconds((from - mediaTime) / 1000)
27
- const iter = sink.samples(mediaTime / 1000)
30
+ const iter = sink.samples(mediaTime / 1000, mediaEnd / 1000)
28
31
 
29
32
  const first = await iter.next()
30
33
  if (first.done)