mirror of https://github.com/odrling/Aegisub
Rearrange ThreadedFrameSource::Entry to allow the use of wxMutexLocker
Originally committed to SVN as r4788.
This commit is contained in:
parent
d3fca38ee7
commit
dca2bd43fe
|
@ -115,22 +115,26 @@ AegiVideoFrame const& ThreadedFrameSource::ProcFrame(int frameNum, double time,
|
||||||
|
|
||||||
void *ThreadedFrameSource::Entry() {
|
void *ThreadedFrameSource::Entry() {
|
||||||
while (!TestDestroy() && run) {
|
while (!TestDestroy() && run) {
|
||||||
jobMutex.Lock();
|
double time;
|
||||||
if (nextSubs.get()) {
|
int frameNum;
|
||||||
wxMutexLocker locker(fileMutex);
|
{
|
||||||
subs = nextSubs;
|
wxMutexLocker jobLocker(jobMutex);
|
||||||
singleFrame = -1;
|
|
||||||
}
|
|
||||||
if (nextTime == -1.) {
|
|
||||||
jobReady.Wait();
|
|
||||||
jobMutex.Unlock();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
double time = nextTime;
|
if (nextTime == -1.) {
|
||||||
int frameNum = nextFrame;
|
jobReady.Wait();
|
||||||
nextTime = -1.;
|
continue;
|
||||||
jobMutex.Unlock();
|
}
|
||||||
|
|
||||||
|
if (nextSubs.get()) {
|
||||||
|
wxMutexLocker fileLocker(fileMutex);
|
||||||
|
subs = nextSubs;
|
||||||
|
singleFrame = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
time = nextTime;
|
||||||
|
frameNum = nextFrame;
|
||||||
|
nextTime = -1.;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
AegiVideoFrame const& frame = ProcFrame(frameNum, time);
|
AegiVideoFrame const& frame = ProcFrame(frameNum, time);
|
||||||
|
|
Loading…
Reference in New Issue