Defined constant to control thumbnail generation timeout.

This commit is contained in:
Tats
2016-02-17 16:06:02 -05:00
parent 890e4043bc
commit 5600d5a137
2 changed files with 5 additions and 1 deletions

View File

@@ -182,12 +182,12 @@ bool Media::setUri(const QString &uri)
// Try to get a sample from the current position.
// NOTE: There is no guarantee the sample has yet been acquired.
const uint* bits;
if (!impl_->waitForNextBits(ICON_TIMEOUT, (const uchar**)&bits))
{
qDebug() << "Second waiting wrong..." << endl;
return false;
}
// Copy bits into thumbnail QImage.
QImage thumbnail(getWidth(), getHeight(), QImage::Format_ARGB32);
int i=0;

View File

@@ -236,6 +236,10 @@ protected:
QString uri;
QIcon icon;
public:
// Thumbnail generation timeout (in ms).
static const int ICON_TIMEOUT = 1000;
public:
Q_INVOKABLE Media(int id=NULL_UID);
Media(const QString uri_, bool live, double rate, uid id=NULL_UID);