You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
experimenting timing
This commit is contained in:
@@ -67,7 +67,10 @@ namespace openshot
|
||||
break;
|
||||
}
|
||||
|
||||
Time t1 = Time::getCurrentTime();
|
||||
|
||||
videoPlayback->frame = frame;
|
||||
videoPlayback->reset = false;
|
||||
videoPlayback->render.signal();
|
||||
|
||||
audioPlayback->source.setBuffer(frame->GetAudioSampleBuffer());
|
||||
@@ -78,6 +81,12 @@ namespace openshot
|
||||
|
||||
videoPlayback->reset = true;
|
||||
videoPlayback->rendered.wait();
|
||||
|
||||
Time t2 = Time::getCurrentTime();
|
||||
int64 ft = int64(reader->info.fps.Reciprocal().ToDouble() * 1000.0);
|
||||
int64 d = t2.toMilliseconds() - t1.toMilliseconds();
|
||||
//if (0 < d - ft) sleep(int(d - ft));
|
||||
sleep(int(d + ft));
|
||||
}
|
||||
|
||||
if (audioPlayback->isThreadRunning()) audioPlayback->stopThread(-1);
|
||||
|
||||
Reference in New Issue
Block a user