Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library FFTW's fftw_plan_dft_r2c_1d is not thread safe. #743

Open
andre-caldas opened this issue Oct 26, 2021 · 1 comment
Open

Library FFTW's fftw_plan_dft_r2c_1d is not thread safe. #743

andre-caldas opened this issue Oct 26, 2021 · 1 comment

Comments

@andre-caldas
Copy link

andre-caldas commented Oct 26, 2021

The only thread-safe function in FFTW is fftw_execute.

But the FFT filter calls fftw_plan_dft_r2c_1d. This makes MLT non-thread safe.

One solution for this problem is making programs linking to MLT call void fftw_make_planner_thread_safe(void);. Maybe, through some initialization method.

@ddennedy
Copy link
Member

The way the framework is typically used (through a consumer based on mlt_consumer), this function is only called from one thread. If an app is going to read frames directly from a producer as we discussed on the forum, then it can do something to ensure only one thread is performing this task. That does not completely solve the case when the framework consumer is running and the app chooses to do something with the filter. We can add a mutex in the filter, or the app can stop the MLT consumer when it wants to run its task - perhaps in a manner to block restarting it such as from a modal dialog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants