diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-10-13 10:26:58 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-10-13 10:26:58 +0000 |
| commit | 54e71369e1b2dde50af1ee6f41c5375f7ae32610 (patch) | |
| tree | 60155bdabd5461e1500c4c3d6daf7d06ae7881a3 | |
| parent | e48a196c880d9f92804c6e1e3ea5631ae2017dd1 (diff) | |
| download | qmmp-54e71369e1b2dde50af1ee6f41c5375f7ae32610.tar.gz qmmp-54e71369e1b2dde50af1ee6f41c5375f7ae32610.tar.bz2 qmmp-54e71369e1b2dde50af1ee6f41c5375f7ae32610.zip | |
fixed some bugs in cue plugin
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@582 90c681e8-e032-0410-971d-27865f9a5e38
| -rw-r--r-- | src/plugins/Input/cue/cueparser.cpp | 6 | ||||
| -rw-r--r-- | src/plugins/Input/cue/decoder_cue.cpp | 18 |
2 files changed, 22 insertions, 2 deletions
diff --git a/src/plugins/Input/cue/cueparser.cpp b/src/plugins/Input/cue/cueparser.cpp index cf79db5c2..6fdf5d0f8 100644 --- a/src/plugins/Input/cue/cueparser.cpp +++ b/src/plugins/Input/cue/cueparser.cpp @@ -31,7 +31,11 @@ CUEParser::CUEParser(const QString &fileName) { QString album; QFile file(fileName); - file.open(QIODevice::ReadOnly); + if(!file.open(QIODevice::ReadOnly)) + { + qDebug("CUEParser: Error: %s", qPrintable(file.errorString())); + return; + } while (!file.atEnd()) { diff --git a/src/plugins/Input/cue/decoder_cue.cpp b/src/plugins/Input/cue/decoder_cue.cpp index 31d921596..3ebc0fdca 100644 --- a/src/plugins/Input/cue/decoder_cue.cpp +++ b/src/plugins/Input/cue/decoder_cue.cpp @@ -46,11 +46,27 @@ DecoderCUE::~DecoderCUE() bool DecoderCUE::initialize() { + m_input2 = 0; CUEParser parser(QUrl(path).path()); + if (parser.count() == 0) + { + qWarning("DecoderCUE: Invalid cue file"); + return FALSE; + } int track = path.section("#", -1).toInt(); path = parser.filePath(); + if (!QFile::exists(path)) + { + qWarning("DecoderCUE: File \"%s\" doesn't exist", qPrintable(path)); + return FALSE; + } DecoderFactory *df = Decoder::findByPath(path); - if (df) + if (!df) + { + qWarning("DecoderCUE: unsupported file format"); + return FALSE; + } + if (!df->properties().noInput) { m_input2 = new QFile(path); if (!m_input2->open(QIODevice::ReadOnly)) |
