MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / computeWindowBounds

Method computeWindowBounds

src/Qt/VideoCacheThread.cpp:400–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398 }
399
400 void VideoCacheThread::computeWindowBounds(int64_t playhead,
401 int dir,
402 int64_t ahead_count,
403 int64_t timeline_end,
404 int64_t& window_begin,
405 int64_t& window_end) const
406 {
407 if (dir > 0) {
408 // Forward window: [playhead ... playhead + ahead_count]
409 window_begin = playhead;
410 window_end = playhead + ahead_count;
411 }
412 else {
413 // Backward window: [playhead - ahead_count ... playhead]
414 window_begin = playhead - ahead_count;
415 window_end = playhead;
416 }
417 // Clamp to [1 ... timeline_end]
418 window_begin = std::max<int64_t>(window_begin, 1);
419 window_end = std::min<int64_t>(window_end, timeline_end);
420 }
421
422 bool VideoCacheThread::prefetchWindow(CacheBase* cache,
423 int64_t window_begin,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected