Commit 5005628
root
Set filter graph threads to 1 for thread safety
Set the filter graph thread count to 1 in Graph.__cinit__ to prevent
potential thread safety issues when using filter graphs in multi-threaded
applications.
By default, FFmpeg's filter graph may use multiple threads for parallel
filter execution. However, this can cause race conditions or unexpected
behavior when the filter graph is accessed from Python code that isn't
designed for concurrent access.
Setting threads=1 ensures deterministic, single-threaded filter execution,
which is safer for typical PyAV usage patterns.1 parent 8fb7d1d commit 5005628
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
0 commit comments