Moving omp taskwait to after the ProcessVideoPacket() method, since that is the only place it is useful.

This commit is contained in:
Jonathan Thomas
2018-08-12 00:36:03 -05:00
parent 8216795c33
commit 6b5e2d427b

View File

@@ -607,6 +607,12 @@ std::shared_ptr<Frame> FFmpegReader::ReadStream(int64_t requested_frame)
// Process Video Packet
ProcessVideoPacket(requested_frame);
if (!use_omp_threads) {
// Wait on each OMP task to complete before moving on to the next one. This slows
// down processing considerably, but might be more stable on some systems.
#pragma omp taskwait
}
}
}
@@ -638,12 +644,6 @@ std::shared_ptr<Frame> FFmpegReader::ReadStream(int64_t requested_frame)
ProcessAudioPacket(requested_frame, location.frame, location.sample_start);
}
if (!use_omp_threads) {
// Wait on each OMP task to complete before moving on to the next one. This slows
// down processing considerably, but might be more stable on some systems.
#pragma omp taskwait
}
// Check if working frames are 'finished'
if (!is_seeking) {
// Check for any missing frames