Commit e64f4616 authored by luyikei's avatar luyikei Committed by Hugo Beauzée-Luyssen
Browse files

Media: Store baseClip as QSharedPointer


Signed-off-by: Hugo Beauzée-Luyssen's avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent fe483221
......@@ -114,11 +114,11 @@ Media::id() const
return m_mlMedia->id();
}
Clip*
QSharedPointer<Clip>
Media::baseClip()
{
if ( m_baseClip == nullptr )
m_baseClip = new Clip( sharedFromThis(), 0, Backend::IInput::EndOfMedia, m_baseClipUuid );
m_baseClip.reset( new Clip( sharedFromThis(), 0, Backend::IInput::EndOfMedia, m_baseClipUuid ) );
return m_baseClip;
}
......
......@@ -86,7 +86,7 @@ public:
QString title() const;
qint64 id() const;
Clip* baseClip();
QSharedPointer<Clip> baseClip();
/**
* @brief cut Creates a clip to represent a cut of a media
......@@ -114,7 +114,7 @@ protected:
medialibrary::MediaPtr m_mlMedia;
medialibrary::FilePtr m_mlFile;
QUuid m_baseClipUuid;
mutable Clip* m_baseClip;
QSharedPointer<Clip> m_baseClip;
QHash<QUuid, QSharedPointer<Clip>> m_clips;
signals:
......
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