Fetch audio thumbs one after another, so that we don't create hundreds of threads:

http://kdenlive.org/mantis/view.php?id=1383

svn path=/trunk/kdenlive/; revision=4309
parent d9e091ef
......@@ -50,6 +50,8 @@ ClipManager::~ClipManager()
{
qDeleteAll(m_clipList);
m_clipList.clear();
m_audioThumbsQueue.clear();
m_generatingAudioId.clear();
}
void ClipManager::clear()
......
......@@ -140,7 +140,7 @@ void DocClipBase::slotCreateAudioTimer()
void DocClipBase::askForAudioThumbs()
{
if (m_thumbProd && m_audioTimer) slotGetAudioThumbs();
if (m_thumbProd && m_audioTimer) m_thumbProd->askForAudioThumbs(getId());
}
void DocClipBase::slotClearAudioCache()
......
......@@ -44,7 +44,6 @@ ProjectItem::ProjectItem(QTreeWidget * parent, DocClipBase *clip) :
if (m_clipType != UNKNOWN) slotSetToolTip();
setText(0, name);
setText(1, m_clip->description());
m_clip->askForAudioThumbs();
GenTime duration = m_clip->duration();
if (duration != GenTime()) setData(0, DurationRole, Timecode::getEasyTimecode(duration, KdenliveSettings::project_fps()));
//setFlags(Qt::NoItemFlags);
......@@ -64,7 +63,6 @@ ProjectItem::ProjectItem(QTreeWidgetItem * parent, DocClipBase *clip) :
m_clipType = (CLIPTYPE) m_clip->getProperty("type").toInt();
setText(0, name);
setText(1, m_clip->description());
m_clip->askForAudioThumbs();
GenTime duration = m_clip->duration();
if (duration != GenTime()) setData(0, DurationRole, Timecode::getEasyTimecode(duration, KdenliveSettings::project_fps()));
//setFlags(Qt::NoItemFlags);
......@@ -228,7 +226,6 @@ void ProjectItem::setProperties(const QMap < QString, QString > &attributes, con
}
m_clip->setProperties(attributes);
m_clip->setMetadata(metadata);
m_clip->askForAudioThumbs();
if (m_clip->description().isEmpty()) {
if (metadata.contains("description")) {
......
......@@ -756,6 +756,7 @@ void ProjectList::slotAddClip(DocClipBase *clip, bool getProperties)
QDomElement e = clip->toXML().cloneNode().toElement();
e.removeAttribute("file_hash");
m_infoQueue.insert(clip->getId(), e);
clip->askForAudioThumbs();
//m_render->getFileProperties(clip->toXML(), clip->getId(), true);
}
const QString parent = clip->getProperty("groupid");
......@@ -1227,6 +1228,7 @@ void ProjectList::slotReplyGetFileProperties(const QString &clipId, Mlt::Produce
}
//Q_ASSERT_X(item->referencedClip(), "void ProjectList::slotReplyGetFileProperties", QString("Item with groupName %1 does not have a clip associated").arg(item->groupName()).toLatin1());
item->referencedClip()->setProducer(producer, replace);
item->referencedClip()->askForAudioThumbs();
if (!replace && item->data(0, Qt::DecorationRole).isNull()) {
requestClipThumbnail(clipId);
}
......
Markdown is supported
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