diff options
author | Angus Cummings <angus.cummings@nokia.com> | 2012-04-12 14:44:28 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-14 06:57:33 +0200 |
commit | e24f4fed534dfee0dc3f31be0a70f9348c73be19 (patch) | |
tree | fa9d298af7742ae0d1324e5bdaccc4cdf541bac4 /src/multimedia/audio/qaudiodecoder.cpp | |
parent | 02efdccae982452a101ea0c703d308ab8189e9fb (diff) |
expanding unit test for QAudioDecoder
Looking for feedback concerning:
implementation of the change
desired functionality of QAudioDecoder
Changed the behaviour of QAudioDecoder for
more sane error output
Change-Id: I82193a94b6fe1ef4202a4ac7bd95c607e0bee9c6
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Diffstat (limited to 'src/multimedia/audio/qaudiodecoder.cpp')
-rw-r--r-- | src/multimedia/audio/qaudiodecoder.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/multimedia/audio/qaudiodecoder.cpp b/src/multimedia/audio/qaudiodecoder.cpp index 1253deb8c..1e5983af1 100644 --- a/src/multimedia/audio/qaudiodecoder.cpp +++ b/src/multimedia/audio/qaudiodecoder.cpp @@ -140,9 +140,7 @@ QAudioDecoder::QAudioDecoder(QObject *parent) Q_D(QAudioDecoder); d->provider = QMediaServiceProvider::defaultServiceProvider(); - if (d->service == 0) { - d->error = ServiceMissingError; - } else { + if (d->service) { d->control = qobject_cast<QAudioDecoderControl*>(d->service->requestControl(QAudioDecoderControl_iid)); if (d->control != 0) { connect(d->control, SIGNAL(stateChanged(QAudioDecoder::State)), SLOT(_q_stateChanged(QAudioDecoder::State))); @@ -157,6 +155,10 @@ QAudioDecoder::QAudioDecoder(QObject *parent) connect(d->control ,SIGNAL(durationChanged(qint64)), this, SIGNAL(durationChanged(qint64))); } } + if (!d->control) { + d->error = ServiceMissingError; + d->errorString = tr("The QAudioDecoder object does not have a valid service"); + } } |