GstEnginePipeline: Fix file descriptor exhaustion by using shared thread pool
Replace per-pipeline QThreadPool with a shared static pool to prevent file descriptor and thread exhaustion. Each GstEnginePipeline was creating its own thread pool, leading to resource accumulation during frequent pipeline creation/destruction (track changes, seeking, crossfade). The shared pool is limited to 2 threads max since state changes are typically sequential per pipeline. This prevents the crash in g_wakeup_new() when creating eventfd for new thread event dispatchers. Fixes #1687
This commit is contained in:
@@ -215,7 +215,8 @@ class GstEnginePipeline : public QObject {
|
||||
static int sId;
|
||||
mutex_protected<int> id_;
|
||||
|
||||
QThreadPool set_state_threadpool_;
|
||||
// Shared thread pool for all pipeline state changes to prevent thread/FD exhaustion
|
||||
static QThreadPool *shared_state_threadpool();
|
||||
|
||||
bool playbin3_support_;
|
||||
bool volume_full_range_support_;
|
||||
|
||||
Reference in New Issue
Block a user