From 45606399bd0353ae42d4a271b916ee84f9c4e3a5 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Fri, 6 Dec 2013 05:23:54 +0000 Subject: refactoring git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3950 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Input/cdaudio/decoder_cdaudio.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/plugins/Input/cdaudio/decoder_cdaudio.cpp') 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 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 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) -- cgit v1.2.3-13-gbd6f