Commit 65af2efc authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

VLCSource: Do not wait for a vout event, that doesn't fly well for audio files.

parent d9414617
......@@ -63,6 +63,13 @@ VLCSource::createRenderer( ISourceRendererEventCb *callback )
return new VLCSourceRenderer( m_backend, this, callback );
}
static bool
checkLengthChanged( const libvlc_event_t* event )
{
Q_ASSERT( event->type == libvlc_MediaPlayerLengthChanged );
return ( event->u.media_player_length_changed.new_length > 0 );
}
bool
VLCSource::preparse()
{
......@@ -73,7 +80,8 @@ VLCSource::preparse()
LibVLCpp::MediaPlayer* mediaPlayer = renderer->mediaPlayer();
{
EventWaiter ew( mediaPlayer, true );
ew.add( libvlc_MediaPlayerVout );
ew.setValidationCallback( &checkLengthChanged );
ew.add( libvlc_MediaPlayerLengthChanged );
renderer->start();
if ( ew.wait( 3000 ) != EventWaiter::Success )
{
......
......@@ -34,7 +34,7 @@
using namespace Backend;
using namespace Backend::VLC;
VLCSourceRenderer::VLCSourceRenderer( VLCBackend* backendInstance, VLCSource *source , ISourceRendererEventCb *callback )
VLCSourceRenderer::VLCSourceRenderer( VLCBackend* backendInstance, VLCSource *source, ISourceRendererEventCb *callback )
: m_backend( backendInstance )
, m_modes( Playback )
, m_callback( callback )
......
......@@ -20,14 +20,16 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "VLCVmemRenderer.h"
#include <QImage>
#include "VLCVmemRenderer.h"
#include "VLCSource.h"
#include "Tools/VlmcDebug.h"
using namespace Backend::VLC;
VmemRenderer::VmemRenderer( VLCBackend* backend, VLCSource *source , ISourceRendererEventCb *callback)
VmemRenderer::VmemRenderer( VLCBackend* backend, VLCSource *source , ISourceRendererEventCb *callback )
: VLCSourceRenderer( backend, source, callback )
, m_snapshotRequired( false )
{
......
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