Commit 46cadb56 authored by luyikei's avatar luyikei

ThumbnailWorker: Fix emitting a wrong position

parent 4bcd3d1d
......@@ -304,7 +304,7 @@ MainWorkflow::takeThumbnail( const QString& uuid, quint32 pos )
{
auto clip = m_sequenceWorkflow->clip( uuid );
auto worker = new ThumbnailWorker( uuid, clip->media()->fileInfo()->absoluteFilePath(),
clip->begin() + pos, clip->input()->width(),
clip->begin(), pos, clip->input()->width(),
clip->input()->height() );
auto t = new QThread;
worker->moveToThread( t );
......
......@@ -5,10 +5,13 @@
#include "Backend/MLT/MLTInput.h"
ThumbnailWorker::ThumbnailWorker( const QString& uuid, const QString& filePath, qint64 pos, quint32 width, quint32 height, QObject* parent )
ThumbnailWorker::ThumbnailWorker( const QString& uuid, const QString& filePath,
qint64 begin, qint64 pos, quint32 width,
quint32 height, QObject* parent )
: QObject( parent )
, m_uuid( uuid )
, m_filePath( filePath )
, m_begin( begin )
, m_pos( pos )
, m_width( width )
, m_height( height )
......@@ -20,6 +23,7 @@ void
ThumbnailWorker::run()
{
Backend::MLT::MLTInput input( qPrintable( m_filePath ) );
input.setBegin( m_begin );
input.setPosition( m_pos );
auto image = input.image( m_width, m_height );
QImage qImg( image, m_width, m_height,
......
......@@ -9,7 +9,9 @@ class ThumbnailWorker : public QObject
{
Q_OBJECT
public:
explicit ThumbnailWorker( const QString& uuid, const QString& filePath, qint64 pos, quint32 width, quint32 height , QObject* parent = 0 );
explicit ThumbnailWorker( const QString& uuid, const QString& filePath,
qint64 begin, qint64 pos, quint32 width,
quint32 height , QObject* parent = 0 );
signals:
void imageReady( const QString& uuid, qint64 pos, const QPixmap& pixmap );
......@@ -20,6 +22,7 @@ public slots:
private:
QString m_uuid;
QString m_filePath;
qint64 m_begin;
qint64 m_pos;
quint32 m_width;
quint32 m_height;
......
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