diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-11-28 15:46:53 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2008-11-28 15:46:53 +0000 |
| commit | 26724c66d4764a77ca653ce6c0a1573e9e97e97c (patch) | |
| tree | f238f84ed390de31471cb95a20e3775f2ea7e3e7 /src/plugins/Input/flac/decoder_flac.cpp | |
| parent | d02787b92ad9a220539498ebbc9f1745a075d10d (diff) | |
| download | qmmp-26724c66d4764a77ca653ce6c0a1573e9e97e97c.tar.gz qmmp-26724c66d4764a77ca653ce6c0a1573e9e97e97c.tar.bz2 qmmp-26724c66d4764a77ca653ce6c0a1573e9e97e97c.zip | |
changed decoder api; fixed flac plugin
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@646 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/flac/decoder_flac.cpp')
| -rw-r--r-- | src/plugins/Input/flac/decoder_flac.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/plugins/Input/flac/decoder_flac.cpp b/src/plugins/Input/flac/decoder_flac.cpp index 44618c919..ec6cb6755 100644 --- a/src/plugins/Input/flac/decoder_flac.cpp +++ b/src/plugins/Input/flac/decoder_flac.cpp @@ -281,7 +281,6 @@ DecoderFLAC::DecoderFLAC(QObject *parent, DecoderFactory *d, QIODevice *i, Outpu m_offset = 0; m_length = 0; - m_cue = FALSE; m_data = new flac_data; m_data->decoder = NULL; data()->input = i; @@ -362,7 +361,6 @@ bool DecoderFLAC::initialize() seekTime = -1.0; totalTime = 0.0; - if (!data()->input) { QString p = m_path; @@ -374,20 +372,18 @@ bool DecoderFLAC::initialize() qWarning("DecoderFLAC: invalid url."); return FALSE; } - qDebug("DecoderFLAC: using embeded cue"); TagLib::FLAC::File fileRef(p.toLocal8Bit ()); //looking for cuesheet comment TagLib::Ogg::XiphComment *xiph_comment = fileRef.xiphComment(); QList <FileInfo*> list; if (xiph_comment && xiph_comment->fieldListMap().contains("CUESHEET")) { - qDebug("DecoderFLAC: found cuesheet xiph comment"); - CUEParser parser(xiph_comment->fieldListMap()["CUESHEET"].toString().toCString(TRUE), m_path); + qDebug("DecoderFLAC: using cuesheet xiph comment."); + CUEParser parser(xiph_comment->fieldListMap()["CUESHEET"].toString().toCString(TRUE), p); int track = m_path.section("#", -1).toInt(); m_offset = parser.offset(track); m_length = parser.length(track); data()->input = new QFile(p); - m_cue = TRUE; } else { @@ -501,9 +497,10 @@ void DecoderFLAC::deinit() len = freq = bitrate = 0; stat = chan = 0; output_size = 0; - if (!input() && data()->input) + if (!input() && data()->input) //delete internal input only { data()->input->close(); + delete data()->input; data()->input = 0; }; } @@ -519,7 +516,7 @@ void DecoderFLAC::run() } mutex()->unlock(); - while (! done && ! m_finish) + while (!done && !m_finish) { mutex()->lock (); // decode @@ -566,22 +563,17 @@ void DecoderFLAC::run() } done = TRUE; - if (! user_stop) - { - m_finish = TRUE; - } + m_finish = !user_stop; } else { - // error in read + // error while read qWarning("DecoderFLAC: Error while decoding stream, File appears to be " "corrupted"); m_finish = TRUE; } - if (m_length && (StateHandler::instance()->elapsed() >= m_length)) m_finish = TRUE; - mutex()->unlock(); } |
