summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2023-01-17 21:11:47 +0100
committerJelle Raaijmakers <jelle@gmta.nl>2023-01-19 11:42:32 +0100
commitdfc57c0dd9b95bcc5072700cc06406e83a05eb26 (patch)
tree261c9f1565fe9f9b94c7f093a576506e73ba62bc /Userland
parentdaf181caa8b520636d561e56d73775e53e98c78d (diff)
downloadserenity-dfc57c0dd9b95bcc5072700cc06406e83a05eb26.zip
SoundPlayer: Don't offset the seek bar with the last seek value
The audio loader plugins already do this internally, if we do this a second time the seek bar will just end up getting rendered at the wrong place.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Applications/SoundPlayer/PlaybackManager.cpp2
-rw-r--r--Userland/Applications/SoundPlayer/PlaybackManager.h2
-rw-r--r--Userland/Applications/SoundPlayer/Player.cpp1
3 files changed, 0 insertions, 5 deletions
diff --git a/Userland/Applications/SoundPlayer/PlaybackManager.cpp b/Userland/Applications/SoundPlayer/PlaybackManager.cpp
index 89aa11fc48..4af3be2f0b 100644
--- a/Userland/Applications/SoundPlayer/PlaybackManager.cpp
+++ b/Userland/Applications/SoundPlayer/PlaybackManager.cpp
@@ -38,7 +38,6 @@ void PlaybackManager::stop()
{
set_paused(true);
m_connection->async_clear_buffer();
- m_last_seek = 0;
if (m_loader)
(void)m_loader->reset();
@@ -59,7 +58,6 @@ void PlaybackManager::seek(int const position)
if (!m_loader)
return;
- m_last_seek = position;
bool paused_state = m_paused;
set_paused(true);
diff --git a/Userland/Applications/SoundPlayer/PlaybackManager.h b/Userland/Applications/SoundPlayer/PlaybackManager.h
index d73f87d577..3c711eb8e2 100644
--- a/Userland/Applications/SoundPlayer/PlaybackManager.h
+++ b/Userland/Applications/SoundPlayer/PlaybackManager.h
@@ -31,7 +31,6 @@ public:
RefPtr<Audio::Loader> loader() const { return m_loader; }
size_t device_sample_rate() const { return m_device_sample_rate; }
- int last_seek() const { return m_last_seek; }
bool is_paused() const { return m_paused; }
float total_length() const { return m_total_length; }
FixedArray<Audio::Sample> const& current_buffer() const { return m_current_buffer; }
@@ -50,7 +49,6 @@ private:
bool m_paused { true };
bool m_loop = { false };
- size_t m_last_seek { 0 };
float m_total_length { 0 };
size_t m_device_sample_rate { 44100 };
size_t m_device_samples_per_buffer { 0 };
diff --git a/Userland/Applications/SoundPlayer/Player.cpp b/Userland/Applications/SoundPlayer/Player.cpp
index 2687d58c0d..31f4aadbf3 100644
--- a/Userland/Applications/SoundPlayer/Player.cpp
+++ b/Userland/Applications/SoundPlayer/Player.cpp
@@ -18,7 +18,6 @@ Player::Player(Audio::ConnectionToServer& audio_client_connection)
auto sample_rate = m_playback_manager.loader()->sample_rate();
float source_to_dest_ratio = static_cast<float>(sample_rate) / m_playback_manager.device_sample_rate();
samples_played *= source_to_dest_ratio;
- samples_played += m_playback_manager.last_seek();
auto played_seconds = samples_played / sample_rate;
time_elapsed(played_seconds);