revised video renderer's invalidate cache to use ranges rather than discrete
frames Previously, when the video renderer received a dirty cache signal, it would proceed to extract all frames from the range and queue them. However, this could be extremely slow for long ranges since it had to iterate through the entire range and calculate the individual frames it contained. Now, we use the same range combining system as audio and automatically calculate the next frame within the range only when necessary. Essentially the same work, but split up over time and done only when needed leading to no discernible UI pause when invalidating cache.
This commit is contained in:
@@ -231,6 +231,14 @@ err_fatal:
|
||||
return 0;
|
||||
}
|
||||
|
||||
rational Timecode::snap_time_to_timebase(const rational &time, const rational &timebase)
|
||||
{
|
||||
// Just convert to a timestamp in timebase units and back
|
||||
int64_t timestamp = time_to_timestamp(time, timebase);
|
||||
|
||||
return timestamp_to_time(timestamp, timebase);
|
||||
}
|
||||
|
||||
rational Timecode::timestamp_to_time(const int64_t ×tamp, const rational &timebase)
|
||||
{
|
||||
return rational(timestamp) * timebase;
|
||||
|
||||
Reference in New Issue
Block a user