Commit 01f77c91 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen
Browse files

Using a safer method to wait for a vout to be ready

parent 6b0da608
......@@ -252,3 +252,10 @@ void MediaPlayer::nextFrame()
libvlc_media_player_next_frame( m_internalPtr, m_ex );
CheckVlcppException( m_ex );
}
bool MediaPlayer::hasVout()
{
bool res = libvlc_media_player_has_vout( m_internalPtr, m_ex );
CheckVlcppException( m_ex );
return res;
}
......@@ -59,6 +59,7 @@ namespace LibVLCpp
int getHeight();
float getFps();
void nextFrame();
bool hasVout();
private:
static void callbacks( const libvlc_event_t* event, void* self );
......
......@@ -81,7 +81,7 @@ void MetaDataWorker::getMetaData()
//Until we have a way of knowing when it is, both getWidth and getHeight method
//will trigger exception... so we shut it up.
LibVLCpp::Exception::setErrorCallback( LibVLCpp::Exception::silentExceptionHandler );
while ( m_mediaPlayer->getWidth() == 0 )
while ( m_mediaPlayer->hasVout() == false )
SleepMS( 1 ); //Ugly isn't it :)
LibVLCpp::Exception::setErrorCallback( NULL );
......
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