Commit a7cdc29f authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Avoid infinite loop when metadata computing fails.

parent 372863b9
......@@ -114,9 +114,16 @@ MetaDataWorker::metaDataAvailable()
//will trigger exception... so we shut it up.
if ( m_media->getFileType() != Media::Audio )
{
while ( m_mediaPlayer->hasVout() == false )
m_timer.restart();
while ( m_mediaPlayer->hasVout() == false &&
m_timer.elapsed() < 3000 )
{
SleepMS( 1 ); //Ugly isn't it :)
SleepMS( 10 ); //Ugly isn't it :)
}
if ( m_mediaPlayer->hasVout() == false )
{
emit failed( m_media );
return ;
}
quint32 width, height;
......
......@@ -24,10 +24,13 @@
#ifndef METADATAWORKER_H
#define METADATAWORKER_H
#include "Media.h"
#include <QList>
#include <QTemporaryFile>
#include <QLabel>
#include "Media.h"
#include <QTemporaryFile>
#include <QTime>
namespace LibVLCpp
{
class MediaPlayer;
......@@ -66,6 +69,7 @@ class MetaDataWorker : public QObject
bool m_lengthHasChanged;
unsigned char* m_audioBuffer;
QTime m_timer;
private slots:
void renderSnapshot();
......
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