mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 03:10:12 +02:00
moved the fix to include seeking via position
This commit is contained in:
@@ -427,21 +427,19 @@ AudioOutput::seek( qint64 milliseconds )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qint64 duration = AudioEngine::instance()->currentTrackTotalTime();
|
||||||
|
// for some tracks, seeking to an end seems not to work correctly with libvlc
|
||||||
|
// (tracks enter a random and infinite loop) - this is a temporary fix for that
|
||||||
|
if (duration == milliseconds)
|
||||||
|
milliseconds -= 1;
|
||||||
|
|
||||||
if ( m_seekable )
|
if ( m_seekable )
|
||||||
{
|
{
|
||||||
|
|
||||||
// tDebug() << Q_FUNC_INFO << "AudioOutput:: seeking" << milliseconds << "msec";
|
|
||||||
|
|
||||||
// for some tracks, seeking to an end seems not to work correctly with libvlc
|
|
||||||
// (tracks enter a random and infinite loop) - this is a temporary fix for that
|
|
||||||
if (milliseconds == libvlc_media_player_get_length(m_vlcPlayer) && milliseconds > 0)
|
|
||||||
milliseconds -= 1;
|
|
||||||
libvlc_media_player_set_time( m_vlcPlayer, milliseconds );
|
libvlc_media_player_set_time( m_vlcPlayer, milliseconds );
|
||||||
setCurrentTime( milliseconds );
|
setCurrentTime( milliseconds );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qint64 duration = AudioEngine::instance()->currentTrackTotalTime();
|
|
||||||
float position = float(float(milliseconds) / duration);
|
float position = float(float(milliseconds) / duration);
|
||||||
libvlc_media_player_set_position(m_vlcPlayer, position);
|
libvlc_media_player_set_position(m_vlcPlayer, position);
|
||||||
tDebug() << Q_FUNC_INFO << "AudioOutput:: seeking via position" << position << "pos";
|
tDebug() << Q_FUNC_INFO << "AudioOutput:: seeking via position" << position << "pos";
|
||||||
|
Reference in New Issue
Block a user