From 503647557aa43e8be23133f8619c6c66bfe2f470 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 27 Aug 2019 08:40:01 +0200 Subject: Make InputBase::setBitrate fail with invalid_argument instead of return value --- src/input/Zmq.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/input/Zmq.cpp') 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 -- cgit v1.2.3