aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/qmmp/soundcore.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/qmmp/soundcore.cpp b/src/qmmp/soundcore.cpp
index 4dccb3c1c..856f035e5 100644
--- a/src/qmmp/soundcore.cpp
+++ b/src/qmmp/soundcore.cpp
@@ -232,7 +232,7 @@ void SoundCore::startNextSource()
InputSource *s = m_sources.dequeue();
m_url = s->url();
- if(s->ioDevice() && !s->ioDevice()->open(QIODevice::ReadOnly))
+ if(s->ioDevice() && !s->ioDevice()->isOpen() && !s->ioDevice()->open(QIODevice::ReadOnly))
{
qWarning("SoundCore: input error: %s", qPrintable(s->ioDevice()->errorString()));
m_url.clear();
@@ -272,9 +272,7 @@ void SoundCore::startNextSource()
}
else
{
- m_sources.prepend(s); //try for next engine
- if(s->ioDevice())
- s->ioDevice()->close();
+ m_sources.prepend(s); //try next engine
m_nextState = ANOTHER_ENGINE;
if(state() == Qmmp::Stopped || state() == Qmmp::Buffering)
{