diff options
author | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-02-16 11:25:41 (GMT) |
---|---|---|
committer | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-02-16 17:57:37 (GMT) |
commit | 6c67fef3218ec5361b3f9a30fc53c529295da9e4 (patch) | |
tree | 50d2da8723dbcada482604635a9546434d13244d | |
parent | f25119cb0406341e7cbb6ac679662f28fc7ab431 (diff) | |
download | Qt-6c67fef3218ec5361b3f9a30fc53c529295da9e4.zip Qt-6c67fef3218ec5361b3f9a30fc53c529295da9e4.tar.gz Qt-6c67fef3218ec5361b3f9a30fc53c529295da9e4.tar.bz2 |
Added missing override in audio output example
Because the QIODevice-derived class Generator owns its own internal
buffer, it must override bytesAvailable().
Reviewed-by: trustme
-rw-r--r-- | examples/multimedia/audiooutput/audiooutput.cpp | 5 | ||||
-rw-r--r-- | examples/multimedia/audiooutput/audiooutput.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/examples/multimedia/audiooutput/audiooutput.cpp b/examples/multimedia/audiooutput/audiooutput.cpp index b44accd..9a9af86 100644 --- a/examples/multimedia/audiooutput/audiooutput.cpp +++ b/examples/multimedia/audiooutput/audiooutput.cpp @@ -75,6 +75,11 @@ void Generator::start() open(QIODevice::ReadOnly); } +qint64 Generator::bytesAvailable() const +{ + return (SECONDS*SYSTEM_FREQ*2)-pos + QIODevice::bytesAvailable(); +} + void Generator::stop() { close(); diff --git a/examples/multimedia/audiooutput/audiooutput.h b/examples/multimedia/audiooutput/audiooutput.h index 372cf78..eba6446 100644 --- a/examples/multimedia/audiooutput/audiooutput.h +++ b/examples/multimedia/audiooutput/audiooutput.h @@ -72,6 +72,7 @@ public: qint64 readData(char *data, qint64 maxlen); qint64 writeData(const char *data, qint64 len); + qint64 bytesAvailable() const; private: int putShort(char *t, unsigned int value); |