aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorJohannes Schickel2010-01-03 22:41:35 +0000
committerJohannes Schickel2010-01-03 22:41:35 +0000
commitb2355cac9fd4ce6bec6d8058bd5dd4718d47d3ca (patch)
treeae492b7f615d6d808d145bba83d6779886353b9b /sound
parent5433ba01fa52501f5624de1615c3e9f72bb26fd9 (diff)
downloadscummvm-rg350-b2355cac9fd4ce6bec6d8058bd5dd4718d47d3ca.tar.gz
scummvm-rg350-b2355cac9fd4ce6bec6d8058bd5dd4718d47d3ca.tar.bz2
scummvm-rg350-b2355cac9fd4ce6bec6d8058bd5dd4718d47d3ca.zip
- Remove unsafe default constructor of Audio::Timestamp.
- Add an assert which prevents the _frameRate from being 0 in the Audio::Timestamp constructor. svn-id: r46958
Diffstat (limited to 'sound')
-rw-r--r--sound/timestamp.cpp5
-rw-r--r--sound/timestamp.h6
2 files changed, 3 insertions, 8 deletions
diff --git a/sound/timestamp.cpp b/sound/timestamp.cpp
index 13de41ff06..c85ec47ae8 100644
--- a/sound/timestamp.cpp
+++ b/sound/timestamp.cpp
@@ -27,12 +27,9 @@
namespace Audio {
-Timestamp::Timestamp() :
- _msecs(0), _frameRate(0), _frameOffset(0) {
-}
-
Timestamp::Timestamp(uint32 m, int frameRate) :
_msecs(m), _frameRate(frameRate), _frameOffset(0) {
+ assert(_frameRate > 0);
}
diff --git a/sound/timestamp.h b/sound/timestamp.h
index 72671aaa77..1a30b4353e 100644
--- a/sound/timestamp.h
+++ b/sound/timestamp.h
@@ -44,12 +44,10 @@ protected:
/* Total time: msecs + frame_offset/frame_rate */
public:
- Timestamp();
-
/**
* Set up a timestamp with a given time and framerate.
- * @param msecs staring time in milliseconds
- * @param frameRate number of frames per second
+ * @param msecs staring time in milliseconds
+ * @param frameRate number of frames per second (must be > 0)
*/
Timestamp(uint32 msecs, int frameRate);