From 0aec4079844ecace3e16106e4da0f949c8fa1d45 Mon Sep 17 00:00:00 2001 From: David Sansome Date: Mon, 29 Mar 2010 14:00:44 +0000 Subject: [PATCH] Only prune the scope buffer list from a single thread. Maybe fixes issue #120 --- src/xine-engine.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/xine-engine.cpp b/src/xine-engine.cpp index d8aef7970..ec2722a04 100644 --- a/src/xine-engine.cpp +++ b/src/xine-engine.cpp @@ -31,6 +31,8 @@ #include #include +#include + extern "C" { #include @@ -259,9 +261,6 @@ XineEngine::load( const QUrl &url, bool isStream ) qDebug() << "After xine_open() *****"; #ifndef XINE_SAFE_MODE - //we must ensure the scope is pruned of old buffers - PruneScope(); - xine_post_out_t *source = xine_get_audio_source( m_stream ); xine_post_in_t *target = (xine_post_in_t*)xine_post_input( m_post, const_cast("audio in") ); xine_post_wire( source, target ); @@ -692,9 +691,6 @@ XineEngine::scope() if (myChannels > 2) return m_scope; - //prune the buffer list and update m_currentVpts - PruneScope(); - for( int n, frame = 0; frame < 512; ) { MyNode *best_node = 0; @@ -1307,11 +1303,9 @@ PruneScopeThread::PruneScopeThread(XineEngine *parent) } void PruneScopeThread::run() { - QTimer* timer = new QTimer; - connect(timer, SIGNAL(timeout()), engine_, SLOT(PruneScope()), Qt::DirectConnection); + boost::scoped_ptr timer(new QTimer); + connect(timer.get(), SIGNAL(timeout()), engine_, SLOT(PruneScope()), Qt::DirectConnection); timer->start(1000); exec(); - - delete timer; }