diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2019-08-27 08:40:01 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2019-08-27 08:40:01 +0200 |
commit | 503647557aa43e8be23133f8619c6c66bfe2f470 (patch) | |
tree | 6d333044845083902a43ee422e9165a4ac75643d /src/input/Zmq.cpp | |
parent | 70e72e84212f5b6b15f2e1a2b2d95d1d67abac7f (diff) | |
download | dabmux-503647557aa43e8be23133f8619c6c66bfe2f470.tar.gz dabmux-503647557aa43e8be23133f8619c6c66bfe2f470.tar.bz2 dabmux-503647557aa43e8be23133f8619c6c66bfe2f470.zip |
Make InputBase::setBitrate fail with invalid_argument instead of return value
Diffstat (limited to 'src/input/Zmq.cpp')
-rw-r--r-- | src/input/Zmq.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/input/Zmq.cpp b/src/input/Zmq.cpp index ce7f439..ec5f9b9 100644 --- a/src/input/Zmq.cpp +++ b/src/input/Zmq.cpp @@ -239,8 +239,12 @@ int ZmqBase::close() int ZmqBase::setBitrate(int bitrate) { + if (bitrate <= 0) { + throw invalid_argument("Invalid bitrate " + to_string(bitrate) + " for " + m_name); + } + m_bitrate = bitrate; - return bitrate; // TODO do a nice check here + return bitrate; } // size corresponds to a frame size. It is constant for a given bitrate |