Commit c794e399 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

Media: Construct the base/root clip when constructing the media

parent 2ee3dd3d
...@@ -66,7 +66,6 @@ QPixmap* Media::defaultSnapshot = nullptr; ...@@ -66,7 +66,6 @@ QPixmap* Media::defaultSnapshot = nullptr;
Media::Media( medialibrary::MediaPtr media ) Media::Media( medialibrary::MediaPtr media )
: m_input( nullptr ) : m_input( nullptr )
, m_mlMedia( media ) , m_mlMedia( media )
, m_baseClip( nullptr )
{ {
auto files = media->files(); auto files = media->files();
Q_ASSERT( files.size() > 0 ); Q_ASSERT( files.size() > 0 );
...@@ -81,6 +80,7 @@ Media::Media( medialibrary::MediaPtr media ) ...@@ -81,6 +80,7 @@ Media::Media( medialibrary::MediaPtr media )
if ( m_mlFile == nullptr ) if ( m_mlFile == nullptr )
vlmcFatal( "No file representing media %s", media->title().c_str(), "was found" ); vlmcFatal( "No file representing media %s", media->title().c_str(), "was found" );
m_input.reset( new Backend::MLT::MLTInput( m_mlFile->mrl().c_str() ) ); m_input.reset( new Backend::MLT::MLTInput( m_mlFile->mrl().c_str() ) );
m_baseClip = new Clip( sharedFromThis() );
} }
QString QString
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <memory> #include <memory>
#include <QEnableSharedFromThis>
#include <QString> #include <QString>
#include <QObject> #include <QObject>
#include <QXmlStreamWriter> #include <QXmlStreamWriter>
...@@ -61,7 +62,7 @@ class Clip; ...@@ -61,7 +62,7 @@ class Clip;
/** /**
* Represents a basic container for media informations. * Represents a basic container for media informations.
*/ */
class Media : public QObject class Media : public QObject, public QEnableSharedFromThis<Media>
{ {
Q_OBJECT Q_OBJECT
......
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