diff --git a/MediaImpl.cpp b/MediaImpl.cpp index 30ff7f6..90dcc42 100644 --- a/MediaImpl.cpp +++ b/MediaImpl.cpp @@ -62,10 +62,7 @@ const uchar* MediaImpl::getBits() _bitsChanged = false; // Return data. - if (_currentFrameSample == NULL) - return NULL; - else - return _data; + return (hasBits() ? _data : NULL); } QString MediaImpl::getUri() const diff --git a/MediaImpl.h b/MediaImpl.h index ff121ea..ead5607 100644 --- a/MediaImpl.h +++ b/MediaImpl.h @@ -98,6 +98,9 @@ public: */ const uchar* getBits(); + /// Returns true iff bits have started flowing (ie. if there is at least a first sample available). + bool hasBits() const { return (_currentFrameSample != NULL); } + /// Returns true iff bits have changed since last call to getBits(). bool bitsHaveChanged() const { return _bitsChanged; }