diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2013-12-06 05:23:54 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2013-12-06 05:23:54 +0000 |
| commit | 45606399bd0353ae42d4a271b916ee84f9c4e3a5 (patch) | |
| tree | cf3548f06d89559a2f7a8d92120476acb6c91472 | |
| parent | 1827a9baec6b8caacc5a83144bd65fddabe1f78e (diff) | |
| download | qmmp-45606399bd0353ae42d4a271b916ee84f9c4e3a5.tar.gz qmmp-45606399bd0353ae42d4a271b916ee84f9c4e3a5.tar.bz2 qmmp-45606399bd0353ae42d4a271b916ee84f9c4e3a5.zip | |
refactoring
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3950 90c681e8-e032-0410-971d-27865f9a5e38
| -rw-r--r-- | src/plugins/Input/cdaudio/decoder_cdaudio.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/plugins/Input/cdaudio/decoder_cdaudio.cpp b/src/plugins/Input/cdaudio/decoder_cdaudio.cpp index 7c1c83820..f7308354e 100644 --- a/src/plugins/Input/cdaudio/decoder_cdaudio.cpp +++ b/src/plugins/Input/cdaudio/decoder_cdaudio.cpp @@ -247,26 +247,21 @@ QList <CDATrack> DecoderCDAudio::generateTrackList(const QString &device) qDebug ("DecoderCDAudio: disc id = %x", cddb_disc_get_discid (cddb_disc)); uint id = cddb_disc_get_discid (cddb_disc); - int matches = 0; if(readFromCache(&tracks, id)) qDebug("DecoderCDAudio: using local cddb cache"); - else if ((matches = cddb_query (cddb_conn, cddb_disc)) == -1) - { - - qWarning ("DecoderCDAudio: unable to query the CDDB server, error: %s", - cddb_error_str (cddb_errno(cddb_conn))); - } - else if (!matches) - qDebug ("DecoderCDAudio: no CDDB info found"); else { - cddb_read(cddb_conn, cddb_disc); - if (cddb_errno (cddb_conn) != CDDB_ERR_OK) + int matches = cddb_query (cddb_conn, cddb_disc); + if(matches == -1) { - qWarning ("DecoderCDAudio: unable to read the CDDB info: %s", + qWarning ("DecoderCDAudio: unable to query the CDDB server, error: %s", cddb_error_str (cddb_errno(cddb_conn))); } - else + else if(matches == 0) + { + qDebug ("DecoderCDAudio: no CDDB info found"); + } + else if(cddb_read(cddb_conn, cddb_disc)) { for (int i = first_track_number; i <= last_track_number; ++i) { @@ -283,6 +278,11 @@ QList <CDATrack> DecoderCDAudio::generateTrackList(const QString &device) } saveToCache(tracks, id); } + else + { + qWarning ("DecoderCDAudio: unable to read the CDDB info: %s", + cddb_error_str (cddb_errno(cddb_conn))); + } } } if (cddb_disc) |
