int clipLength = [self.clipsSlider currentValue];
double videoClipEnd = _videoClipBegin + clipLength;
//计算真实剪辑时间段
double endTemp = 0;
double period = 0;
double extra = 0;
NSArray *array = [self.timeProgress getNormalColorMap];
for (NSUInteger i = 0; i < array.count; ++i) {
CloudTimeColorMap *timeMap = [array objectAtIndex:i];
if (timeMap.endValue < _videoClipBegin) {
continue;
}
if (_videoClipBegin >= timeMap.startValue && _videoClipBegin <= timeMap.endValue)
{
extra = _videoClipBegin - timeMap.startValue;
}
if (videoClipEnd < timeMap.startValue) {
break;
}else if(videoClipEnd >= timeMap.startValue && videoClipEnd <= timeMap.endValue) {
endTemp = videoClipEnd;
period += (endTemp - timeMap.startValue);
}else if (videoClipEnd > timeMap.endValue) {
endTemp = timeMap.endValue;
period += (timeMap.endValue - timeMap.startValue);
}
}
videoClipEnd = endTemp;
clipLength = period - extra;
计算有效时间段
最新推荐文章于 2023-01-04 14:41:37 发布