GstEngine: Disconnect old pipelines

Fixes #1518
This commit is contained in:
Jonas Kvinge 2024-08-11 15:53:41 +02:00
parent 222001bc13
commit 6562cc710c
1 changed files with 5 additions and 1 deletions

View File

@ -591,7 +591,7 @@ void GstEngine::EndOfStreamReached(const int pipeline_id, const bool has_next_tr
}
if (!has_next_track) {
current_pipeline_.reset();
current_pipeline_ = GstEnginePipelinePtr();
BufferingFinished();
}
@ -803,6 +803,8 @@ void GstEngine::StartFadeout() {
return;
}
QObject::disconnect(&*pipeline, nullptr, this, nullptr);
fadeout_pipelines_.insert(pipeline->id(), pipeline);
pipeline->RemoveAllBufferConsumers();
@ -909,6 +911,8 @@ void GstEngine::FinishPipeline(GstEnginePipelinePtr pipeline) {
const int pipeline_id = pipeline->id();
QObject::disconnect(&*pipeline, nullptr, this, nullptr);
if (!pipeline->Finish() && !old_pipelines_.contains(pipeline->id())) {
old_pipelines_.insert(pipeline_id, pipeline);
QObject::connect(&*pipeline, &GstEnginePipeline::Finished, this, [this, pipeline_id]() {