1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-14 12:59:41 +01:00

* Keep current transcoder in memory if we keep using it for the next track.

This commit is contained in:
Christian Muehlhaeuser 2010-10-25 03:59:57 +02:00
parent fd0a27fc7c
commit 883be50062
3 changed files with 27 additions and 20 deletions

View File

@ -147,6 +147,7 @@ AudioEngine::loadTrack( const Tomahawk::result_ptr& result )
err = true;
else
{
m_lastTrack = m_currentTrack;
m_currentTrack = result;
io = TomahawkApp::instance()->getIODeviceForUrl( m_currentTrack );
@ -170,9 +171,10 @@ AudioEngine::loadTrack( const Tomahawk::result_ptr& result )
m_input.clear();
}
if ( m_lastTrack.isNull() || ( m_currentTrack->mimetype() != m_lastTrack->mimetype() ) )
{
if ( !m_transcode.isNull() )
{
m_transcode->clearBuffers();
m_transcode.clear();
}
@ -190,8 +192,12 @@ AudioEngine::loadTrack( const Tomahawk::result_ptr& result )
qDebug() << "Could NOT find suitable transcoder! Stopping audio.";
if ( !m_transcode.isNull() )
{
connect( m_transcode.data(), SIGNAL( streamInitialized( long, int ) ), SLOT( setStreamData( long, int ) ), Qt::DirectConnection );
}
if ( !m_transcode.isNull() )
{
m_transcode->clearBuffers();
m_input = io;
m_audio->clearBuffers();

View File

@ -84,6 +84,7 @@ private:
#endif
Tomahawk::result_ptr m_currentTrack;
Tomahawk::result_ptr m_lastTrack;
PlaylistInterface* m_playlist;
QMutex m_mutex;

View File

@ -98,7 +98,7 @@ TrackModel::data( const QModelIndex& index, int role ) const
return QSize( 0, 18 );
}
if ( role != Qt::DisplayRole )
if ( role != Qt::DisplayRole ) // && role != Qt::ToolTipRole )
return QVariant();
const query_ptr& query = entry->query();