From eefe3438c101abcc660cab2f52b4f69599a4b3d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20M=C3=A9ndez?= Date: Tue, 17 Sep 2024 17:09:27 -0600 Subject: [PATCH] More cleanup, restore buffer clearing on stop --- player.pro | 100 ---------------------------- src/audiosourcefile/mediaplayer.cpp | 2 + 2 files changed, 2 insertions(+), 100 deletions(-) delete mode 100644 player.pro diff --git a/player.pro b/player.pro deleted file mode 100644 index a695fa0..0000000 --- a/player.pro +++ /dev/null @@ -1,100 +0,0 @@ -TEMPLATE = app -TARGET = player - -QT += network \ - multimedia \ - multimediawidgets \ - widgets \ - concurrent \ - dbus - -LIBS += -ltag -lasound -lpulse -lpulse-simple -lpipewire-0.3 -L/usr/lib/python3.11/config-3.11-x86_64-linux-gnu/ -lpython3.11 -INCLUDEPATH += /usr/include/python3.11 /usr/include/pipewire-0.3 /usr/include/spa-0.2 - -HEADERS = \ - audiosource.h \ - audiosourcebluetooth.h \ - audiosourcecd.h \ - audiosourcecoordinator.h \ - audiosourcefile.h \ - audiosourcewspectrumcapture.h \ - controlbuttonswidget.h \ - desktopbasewindow.h \ - desktopplayerwindow.h \ - embeddedbasewindow.h \ - fft.h \ - filebrowsericonprovider.h \ - mainmenuview.h \ - mainwindow.h \ - mediaplayer.h \ - playerview.h \ - playlistmodel.h \ - playlistview.h \ - scale.h \ - scrolltext.h \ - qmediaplaylist.h \ - qmediaplaylist_p.h \ - qplaylistfileparser.h \ - spectrumwidget.h \ - systemaudiocontrol.h \ - titlebar.h \ - util.h - -SOURCES = main.cpp \ - audiosource.cpp \ - audiosourcebluetooth.cpp \ - audiosourcecd.cpp \ - audiosourcecoordinator.cpp \ - audiosourcefile.cpp \ - audiosourcewspectrumcapture.cpp \ - controlbuttonswidget.cpp \ - desktopbasewindow.cpp \ - desktopplayerwindow.cpp \ - embeddedbasewindow.cpp \ - fft.cpp \ - filebrowsericonprovider.cpp \ - mainmenuview.cpp \ - mainwindow.cpp \ - mediaplayer.cpp \ - playerview.cpp \ - playlistmodel.cpp \ - playlistview.cpp \ - scale.cpp \ - scrolltext.cpp \ - qmediaplaylist.cpp \ - qmediaplaylist_p.cpp \ - qplaylistfileparser.cpp \ - spectrumwidget.cpp \ - systemaudiocontrol.cpp \ - titlebar.cpp \ - util.cpp - -target.path = $$[QT_INSTALL_EXAMPLES]/multimedia/player -INSTALLS += target - -FORMS += \ - controlbuttonswidget.ui \ - desktopbasewindow.ui \ - desktopplayerwindow.ui \ - embeddedbasewindow.ui \ - mainmenuview.ui \ - playerview.ui \ - playlistview.ui \ - titlebar.ui - -RESOURCES += \ - uiassets.qrc - -DISTFILES += \ - README.md \ - install.sh \ - python/linamp/__init__.py \ - python/linamp/cdplayer.py \ - python/linamp-mock/__init__.py \ - python/linamp-mock/mock_cdplayer.py \ - python/requirements.txt \ - scale-skin.sh \ - setup.sh \ - shutdown.sh \ - start.sh \ - styles/controlbuttonswidget.shuffleButton.4x.qss diff --git a/src/audiosourcefile/mediaplayer.cpp b/src/audiosourcefile/mediaplayer.cpp index cc47cab..71ca158 100644 --- a/src/audiosourcefile/mediaplayer.cpp +++ b/src/audiosourcefile/mediaplayer.cpp @@ -172,6 +172,8 @@ void MediaPlayer::stop(bool stopAudioOutput) return; if(stopAudioOutput) m_audioOutput->stop(); + // Clear buffers, avoids pops and clicks when playing after stopping + this->reset(); // Fully reset audio output clearAudioOutput(); setupAudioOutput();