You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
OpenMP: Move off deprecated allow_nested boolean
- Replacement openmp_set_max_active_levels() takes an int argument - In OpenMP 5.0 it can be set to openmp_get_supported_active_levels() - Below 5.0, we just set it to our processor count - Move configuration of OpenMP from ad-hoc locations to constructors for FFmpegWriter/Reader and Timeline
This commit is contained in:
@@ -95,6 +95,12 @@ FFmpegWriter::FFmpegWriter(const std::string& path) :
|
||||
info.has_audio = false;
|
||||
info.has_video = false;
|
||||
|
||||
// Configure OpenMP parallelism
|
||||
// Default number of threads per block
|
||||
omp_set_num_threads(OPEN_MP_NUM_PROCESSORS);
|
||||
// Allow nested parallel sections as deeply as supported
|
||||
omp_set_max_active_levels(OPEN_MP_MAX_ACTIVE);
|
||||
|
||||
// Initialize FFMpeg, and register all formats and codecs
|
||||
AV_REGISTER_ALL
|
||||
|
||||
@@ -714,11 +720,6 @@ void FFmpegWriter::write_queued_frames() {
|
||||
spooled_video_frames.clear();
|
||||
spooled_audio_frames.clear();
|
||||
|
||||
// Set the number of threads in OpenMP
|
||||
omp_set_num_threads(OPEN_MP_NUM_PROCESSORS);
|
||||
// Allow nested OpenMP sections
|
||||
omp_set_nested(true);
|
||||
|
||||
// Create blank exception
|
||||
bool has_error_encoding_video = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user