diff --git a/include/exiv2/riffvideo.hpp b/include/exiv2/riffvideo.hpp index 3c6c2605..4112e11f 100644 --- a/include/exiv2/riffvideo.hpp +++ b/include/exiv2/riffvideo.hpp @@ -44,7 +44,7 @@ class EXIV2API RiffVideo : public Image { protected: class HeaderReader { - std::string id_ = ""; + std::string id_; uint64_t size_ = 0; public: @@ -54,7 +54,7 @@ class EXIV2API RiffVideo : public Image { return size_; } - [[nodiscard]] std::string& getId() { + [[nodiscard]] const std::string& getId() const { return id_; } }; @@ -66,7 +66,7 @@ class EXIV2API RiffVideo : public Image { void decodeBlocks(); private: - bool equal(const std::string& str1, const std::string& str2); + static bool equal(const std::string& str1, const std::string& str2); /*! @brief Interpret MainAVIHeader (avih) structure, and save it in the respective XMP container. @@ -130,7 +130,7 @@ class EXIV2API RiffVideo : public Image { */ void readJunk(uint64_t size_); - std::string getStreamType(uint32_t stream); + static std::string getStreamType(uint32_t stream); /*! @brief Calculates Duration of a video, and stores it in the respective XMP container. @param frame_rate Frame rate of the video. diff --git a/src/riffvideo.cpp b/src/riffvideo.cpp index c733ecd7..f7844430 100644 --- a/src/riffvideo.cpp +++ b/src/riffvideo.cpp @@ -740,14 +740,13 @@ void RiffVideo::readJunk(uint64_t size_) { std::string RiffVideo::getStreamType(uint32_t stream) { if (stream == 1) return "Mono"; - else if (stream == 2) + if (stream == 2) return "Stereo"; - else if (stream == 5) + if (stream == 5) return "5.1 Surround Sound"; - else if (stream == 7) + if (stream == 7) return "7.1 Surround Sound"; - else - return "Mono"; + return "Mono"; } void RiffVideo::fillDuration(double frame_rate, size_t frame_count) {