Commit 3a24da5d authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Clip properties audio gain: don't add several audio gain effects

parent 519b4fc0
Pipeline #78242 passed with stage
in 8 minutes and 31 seconds
......@@ -2005,6 +2005,15 @@ void ProjectClip::addAudioStreamEffect(int streamIndex, const QString effectName
for (auto &p : m_audioProducers) {
int stream = p.first / 100;
if (stream == streamIndex) {
// Remove existing effects with same name
int max = p.second->filter_count();
for (int i = 0; i < max; i++) {
QScopedPointer<Mlt::Filter> f(p.second->filter(i));
if (f->get("mlt_service") == addedEffectName) {
p.second->detach(*f.get());
break;
}
}
Mlt::Filter filt(*p.second->profile(), addedEffectName.toUtf8().constData());
if (filt.is_valid()) {
// Add stream effect markup
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment