]> git.sesse.net Git - casparcg/commitdiff
Misc modifications to fix problems found by static code analysis and some simplificat...
authorHelge Norberg <helge.norberg@svt.se>
Thu, 26 Sep 2013 18:28:43 +0000 (20:28 +0200)
committerHelge Norberg <helge.norberg@svt.se>
Thu, 26 Sep 2013 18:28:43 +0000 (20:28 +0200)
27 files changed:
common/diagnostics/graph.cpp
core/frame/frame_transform.h
core/frame/geometry.cpp
core/frame/geometry.h
core/monitor/monitor.h
core/producer/binding.h
core/producer/scene/expression_parser.cpp
core/producer/text/text_producer.cpp
core/producer/text/utils/color.h
core/producer/text/utils/string_metrics.h
core/producer/text/utils/texture_atlas.cpp
core/producer/text/utils/texture_font.cpp
modules/bluefish/util/blue_velvet.cpp
modules/decklink/producer/decklink_producer.cpp
modules/ffmpeg/ffmpeg.cpp
modules/ffmpeg/producer/util/util.cpp
modules/ffmpeg/producer/util/util.h
modules/flash/producer/FlashAxContainer.cpp
modules/flash/producer/FlashAxContainer.h
modules/image/util/image_algorithms.h
modules/psd/layer.cpp
modules/psd/psd_scene_producer.cpp
protocol/amcp/AMCPCommandsImpl.cpp
protocol/amcp/AMCPCommandsImpl.h
protocol/cii/CIIProtocolStrategy.h
protocol/osc/oscpack/OscReceivedElements.cpp
protocol/util/AsyncEventServer.cpp

index d6557122c58b886ea6f0079e743df2490dd6dc15..17cccf50bc75c76210cad4ba24472b6232d5365f 100644 (file)
@@ -272,6 +272,7 @@ struct graph::impl : public drawable
        bool auto_reset_;
 
        impl()
+               : auto_reset_(false)
        {
        }
                
index a109f429eec4f5d44a17798f46319da4b04530b1..65c10e5bf3f5d3f52eaf09c71f41a0878dc05d67 100644 (file)
@@ -100,7 +100,7 @@ public:
        image_transform image_transform;
        audio_transform audio_transform;
 
-       char padding[3];
+       //char padding[(sizeof(core::image_transform) + sizeof(core::audio_transform)) % 16];
        
        frame_transform& operator*=(const frame_transform &other);
        frame_transform operator*(const frame_transform &other) const;
index c547f981d32b93376a928cb8d0753b24e6fc606d..d83d0e73385d1f600c4831eadbe1271618a9c716 100644 (file)
@@ -28,21 +28,23 @@ namespace caspar { namespace core {
 
 struct frame_geometry::impl
 {
-       impl() : type_(frame_geometry::none) {}
-       impl(frame_geometry::geometry_type t, std::vector<float> d) : type_(t), data_(std::move(d)) {}
+       impl(frame_geometry::geometry_type t, std::vector<float>&& d) : type_(t), data_(std::move(d)) {}
        
        frame_geometry::geometry_type type_;
        std::vector<float> data_;
 };
 
-frame_geometry::frame_geometry() : impl_(new impl()) {}
-frame_geometry::frame_geometry(const frame_geometry& rhs) : impl_(rhs.impl_) {}
-frame_geometry::frame_geometry(geometry_type t, std::vector<float> d) : impl_(new impl(t, std::move(d))) {}
+frame_geometry::frame_geometry() {}
+frame_geometry::frame_geometry(geometry_type t, std::vector<float>&& d) : impl_(new impl(t, std::move(d))) {}
 
-const frame_geometry& frame_geometry::operator=(const frame_geometry& rhs) { impl_ = rhs.impl_; return *this; }
-
-frame_geometry::geometry_type frame_geometry::type() { return impl_->type_; }
-const std::vector<float>& frame_geometry::data() { return impl_->data_; }
+frame_geometry::geometry_type frame_geometry::type() const { return impl_ ? impl_->type_ : none; }
+const std::vector<float>& frame_geometry::data() const
+{
+       if (impl_)
+               return impl_->data_;
+       else
+               CASPAR_THROW_EXCEPTION(invalid_operation());
+}
        
 const frame_geometry& frame_geometry::get_default()
 {
index ceb3a9b7ad39ce99ffddba7af1db452e635ba19b..eb1225c451476450ec9eedfc8f22834d3b23e597 100644 (file)
@@ -21,7 +21,7 @@
 
 #pragma once
 
-#include <common/memory.h>
+#include <memory>
 #include <vector>
 
 namespace caspar { namespace core {
@@ -37,18 +37,16 @@ public:
        };
 
        frame_geometry();
-       frame_geometry(const frame_geometry&);
-       frame_geometry(geometry_type, std::vector<float>);
-       const frame_geometry& operator=(const frame_geometry&);
+       frame_geometry(geometry_type, std::vector<float>&&);
+
+       geometry_type type() const ;
+       const std::vector<float>& data() const;
 
-       geometry_type type();
-       const std::vector<float>& data();
-       
        static const frame_geometry& get_default();
 
 private:
        struct impl;
-       spl::shared_ptr<impl> impl_;
+       std::shared_ptr<impl> impl_;
 };
 
 }}
\ No newline at end of file
index 1e9c04dfadd55236c771ccb8be6e7adf88152caa..ef99484fed2df753881c0dd3c8ede2adb064e4fe 100644 (file)
@@ -178,6 +178,8 @@ class basic_subject /* final */ : public reactive::subject<monitor::event>
                {
                        impl_ = std::move(other.impl_);         
                        path_ = std::move(other.path_);
+
+                       return *this;
                }
                                                        
                void on_next(const monitor::event& e) override
@@ -222,6 +224,8 @@ public:
        basic_subject& operator=(basic_subject&& other)
        {
                impl_ = std::move(other.impl_);
+
+               return *this;
        }
 
        operator std::weak_ptr<observer>()
index 953e9422f1e1aae04a5723fe666a03f89efe78ed..06f8c0f8cf19339f84d886ae23b2262f31551f69 100644 (file)
@@ -470,7 +470,7 @@ public:
        }
 
        void on_change(
-                       const std::weak_ptr<void> dependant,
+                       const std::weak_ptr<void>& dependant,
                        const std::function<void ()>& listener) const
        {
                impl_->on_change(dependant, listener);
index 532c63af9d6b73ec1fe3fd3d52b1f59cd03a42b1..3d6c120966b7099fddb733c98d9628b089cccd82 100644 (file)
@@ -239,7 +239,6 @@ struct op
 
 op parse_operator(std::wstring::const_iterator& cursor, const std::wstring& str)
 {
-       std::wstring characters;
        static const wchar_t NONE = L' ';
        wchar_t first = NONE;
 
@@ -267,7 +266,7 @@ op parse_operator(std::wstring::const_iterator& cursor, const std::wstring& str)
                                                L"Did not expect -" + at_position(cursor, str)));
                        else
                                first = ch;
-                       
+
                        ++cursor;
                        break;
                case L'!':
index 7777cd9b2c790dcea5aca416735c3fe8cb0e37b0..98bd0004deb6840248695fcb3abffc05060e4d1a 100644 (file)
@@ -113,8 +113,8 @@ namespace caspar { namespace core {
 
                void init()
                {
-                       fonts.swap(std::move(enumerate_fonts()));
-                       if(fonts.size() > 0)
+                       fonts = enumerate_fonts();
+                       if(!fonts.empty())
                                register_producer_factory(&create_text_producer);
                }
 
@@ -188,7 +188,7 @@ public:
 
                text::string_metrics metrics;
                font_.set_tracking(static_cast<int>(tracking_.value().get()));
-               std::vector<float> vertex_stream(std::move(font_.create_vertex_stream(text_.value().get(), x_, y_, parent_width_, parent_height_, &metrics)));
+               auto vertex_stream = font_.create_vertex_stream(text_.value().get(), x_, y_, parent_width_, parent_height_, &metrics);
                auto frame = frame_factory_->create_frame(vertex_stream.data(), pfd);
                memcpy(frame.image_data().data(), atlas_.data(), frame.image_data().size());
                frame.set_geometry(frame_geometry(frame_geometry::quad_list, std::move(vertex_stream)));
index e3a10f76f68bfc4cc52fdf6d124042db2a45387a..c9c53f288edb500bdae14cd0c917d0fb137eddd6 100644 (file)
@@ -6,7 +6,7 @@ template<typename T>
 struct color
 {
        color() {}
-       color(unsigned int value)
+       explicit color(unsigned int value)
        {
                b =  (value & 0x000000ff)                       / 255.0f;
                g = ((value & 0x0000ff00) >>  8)        / 255.0f;
@@ -14,19 +14,8 @@ struct color
                a = ((value & 0xff000000) >> 24)        / 255.0f;
        }
 
-       color(const color& other) : r(other.r), g(other.g), b(other.b), a(other.a) {}
        color(T alpha, T red, T green, T blue) : r(red), g(green), b(blue), a(alpha) {}
 
-       const color&operator=(const color& other)
-       {
-               r = other.r;
-               g = other.g;
-               b = other.b;
-               a = other.a;
-
-               return *this;
-       }
-
        T r;
        T g;
        T b;
index 3077dd00ff1af5f63cd09ccefd7b9570a6c15ee2..a159f3116ef79c34d9a147236c019c2ef583c628 100644 (file)
@@ -4,7 +4,8 @@ namespace caspar { namespace core { namespace text {
 
        struct string_metrics
        {
-               string_metrics() : width(0), bearingY(0), height(0) {}
+               string_metrics()
+                               : width(0), bearingY(0), protrudeUnderY(0), height(0) {}
                int width;
                int bearingY;
                int protrudeUnderY;
index c7fe4730935648a06e6a4a61d304548dfda69ee1..e322cdfd812a778fc2b91037181dcceb3a4b9fd4 100644 (file)
@@ -62,18 +62,16 @@ public:
 
        rect get_region(int width, int height)
        {
-               int y, best_height, best_width;
-    
                rect region = {0,0,(int)width,(int)height};
 
-               best_height = INT_MAX;
-               best_width = INT_MAX;
+               int best_height = INT_MAX;
+               int best_width = INT_MAX;
                node_iterator best_it = nodes_.end();
 
                auto it = nodes_.begin();
                for(; it != nodes_.end(); ++it)
                {
-                       y = fit(it, width, height);
+                       int y = fit(it, width, height);
                        if( y >= 0 )
                        {
                                if( ( (y + height) < best_height ) ||
@@ -166,11 +164,9 @@ public:
 private:
        int fit(node_iterator it, const size_t width, const size_t height)
        {
-               int x, y, width_left;
-
-               x = (*it).x;
-               y = (*it).y;
-               width_left = (int)width;
+               int x = (*it).x;
+               int y = (*it).y;
+               int width_left = (int)width;
 
                if ((x + width) > (width_ - 1))
                        return -1;
index 29b2398b9d35056807ce280dd64e4218b701ebbd..f728cb5e760aebc60a545879cab4278e5cdad12a 100644 (file)
@@ -40,46 +40,33 @@ private:
                int width, height;
        };
 
-       FT_Library              lib_;
-       FT_Face                 face_;
-       texture_atlas   atlas_;
-       float                   size_;
-       float                   tracking_;
-       bool                    normalize_;
-       std::map<int, glyph_info> glyphs_;
+       std::shared_ptr<FT_LibraryRec_> lib_;
+       std::shared_ptr<FT_FaceRec_>    face_;
+       texture_atlas                                   atlas_;
+       float                                                   size_;
+       float                                                   tracking_;
+       bool                                                    normalize_;
+       std::map<int, glyph_info>               glyphs_;
 
 public:
-       impl::impl(texture_atlas& atlas, const text_info& info, bool normalize_coordinates) : lib_(nullptr), face_(nullptr), atlas_(atlas), size_(info.size), tracking_(info.size*info.tracking/1000.0f), normalize_(normalize_coordinates)
+       impl(texture_atlas& atlas, const text_info& info, bool normalize_coordinates) : atlas_(atlas), size_(info.size), tracking_(info.size*info.tracking/1000.0f), normalize_(normalize_coordinates)
        {
-               try
-               {
-                       FT_Error err;
-                       err = FT_Init_FreeType(&lib_);
-                       if(err) throw freetype_exception("Failed to initialize freetype");
+               FT_Library lib;
+                       
+               if (FT_Init_FreeType(&lib))
+                       throw freetype_exception("Failed to initialize freetype");
 
-                       err = FT_New_Face(lib_, u8(info.font_file).c_str(), 0, &face_);
-                       if(err) throw freetype_exception("Failed to load font");
+               lib_.reset(lib, [](FT_Library ptr) { FT_Done_FreeType(ptr); });
 
-                       err = FT_Set_Char_Size(face_, static_cast<FT_F26Dot6>(size_*64), 0, 72, 72);
-                       if(err) throw freetype_exception("Failed to set font size");
-               }
-               catch(std::exception& ex)
-               {
-                       if(face_ != nullptr)
-                               FT_Done_Face(face_);
-                       if(lib_ != nullptr)
-                               FT_Done_FreeType(lib_);
+               FT_Face face;
+                       
+               if (FT_New_Face(lib_.get(), u8(info.font_file).c_str(), 0, &face))
+                       throw freetype_exception("Failed to load font");
 
-                       throw ex;
-               }
-       }
+               face_.reset(face, [](FT_Face ptr) { FT_Done_Face(ptr); });
 
-       ~impl()
-       {
-               if(face_ != nullptr)
-                       FT_Done_Face(face_);
-               if(lib_ != nullptr)
-                       FT_Done_FreeType(lib_);
+               if (FT_Set_Char_Size(face_.get(), static_cast<FT_F26Dot6>(size_*64), 0, 72, 72))
+                       throw freetype_exception("Failed to set font size");
        }
 
        void set_tracking(int tracking)
@@ -105,11 +92,11 @@ public:
 
                for(int i = range.first; i <= range.last; ++i)
                {
-                       FT_UInt glyph_index = FT_Get_Char_Index(face_, i);
+                       FT_UInt glyph_index = FT_Get_Char_Index(face_.get(), i);
                        if(!glyph_index)        //ignore codes that doesn't have a glyph for now. Might want to map these to a special glyph later.
                                continue;
                        
-                       err = FT_Load_Glyph(face_, glyph_index, flags);
+                       err = FT_Load_Glyph(face_.get(), glyph_index, flags);
                        if(err) continue;       //igonore glyphs that fail to load
 
                        const FT_Bitmap& bitmap = face_->glyph->bitmap; //shorthand notation
@@ -155,17 +142,17 @@ public:
                        {       
                                const glyph_info& coords = glyph_it->second;
 
-                               FT_UInt glyph_index = FT_Get_Char_Index(face_, (*it));
+                               FT_UInt glyph_index = FT_Get_Char_Index(face_.get(), (*it));
 
                                if(use_kerning && previous && glyph_index)
                                {
                                        FT_Vector delta;
-                                       FT_Get_Kerning(face_, previous, glyph_index, FT_KERNING_DEFAULT, &delta);
+                                       FT_Get_Kerning(face_.get(), previous, glyph_index, FT_KERNING_DEFAULT, &delta);
 
                                        pos_x += delta.x / 64.0f;
                                }
 
-                               FT_Load_Glyph(face_, glyph_index, FT_LOAD_NO_BITMAP | FT_LOAD_FORCE_AUTOHINT | FT_LOAD_TARGET_NORMAL);
+                               FT_Load_Glyph(face_.get(), glyph_index, FT_LOAD_NO_BITMAP | FT_LOAD_FORCE_AUTOHINT | FT_LOAD_TARGET_NORMAL);
 
                                float left = (pos_x + face_->glyph->metrics.horiBearingX/64.0f) / parent_width ;
                                float right = ((pos_x + face_->glyph->metrics.horiBearingX/64.0f) + coords.width) / parent_width;
@@ -259,17 +246,17 @@ public:
                        {       
                                const glyph_info& coords = glyph_it->second;
 
-                               FT_UInt glyph_index = FT_Get_Char_Index(face_, (*it));
+                               FT_UInt glyph_index = FT_Get_Char_Index(face_.get(), (*it));
 
                                if(use_kerning && previous && glyph_index)
                                {
                                        FT_Vector delta;
-                                       FT_Get_Kerning(face_, previous, glyph_index, FT_KERNING_DEFAULT, &delta);
+                                       FT_Get_Kerning(face_.get(), previous, glyph_index, FT_KERNING_DEFAULT, &delta);
 
                                        pos_x += delta.x / 64.0f;
                                }
 
-                               FT_Load_Glyph(face_, glyph_index, FT_LOAD_NO_BITMAP | FT_LOAD_FORCE_AUTOHINT | FT_LOAD_TARGET_NORMAL);
+                               FT_Load_Glyph(face_.get(), glyph_index, FT_LOAD_NO_BITMAP | FT_LOAD_FORCE_AUTOHINT | FT_LOAD_TARGET_NORMAL);
 
                                int bearingY = face_->glyph->metrics.horiBearingY >> 6;
                                if(bearingY > result.bearingY)
index 3bb516aaaadf1a463c8b05974733123e7a4b3cac..b7b4a7e6840ce67ebb950833c7dd8547b8a9c979 100644 (file)
@@ -192,7 +192,7 @@ EVideoMode get_video_mode(CBlueVelvet4& blue, const core::video_format_desc& for
 
 spl::shared_ptr<CBlueVelvet4> create_blue()
 {
-       if(!BlueVelvetFactory4 || !encode_hanc_frame || !encode_hanc_frame)
+       if(!BlueVelvetFactory4 || !encode_hanc_frame)
                CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info("Bluefish drivers not found."));
 
        return spl::shared_ptr<CBlueVelvet4>(BlueVelvetFactory4(), BlueVelvetDestroy);
index 1a9eac90c64928e5e7cfe8c3feb073448452609c..d1dbe7e3c2c285a967167cd7a63962915a9dfdce 100644 (file)
@@ -225,8 +225,6 @@ public:
 
                        // Audio
 
-                       std::shared_ptr<core::audio_buffer> audio_buffer;
-                       
                        void* audio_bytes = nullptr;
                        if(FAILED(audio->GetBytes(&audio_bytes)) || !audio_bytes)
                                return S_OK;
index 95599bfcef48a64d0b4a9bc5ee27d5e4589f5b6a..9f5e7ba826107bbb4d72267991948c1aa2fcd4d6 100644 (file)
@@ -98,10 +98,10 @@ static void sanitize(uint8_t *line)
 void log_callback(void* ptr, int level, const char* fmt, va_list vl)
 {
     static int print_prefix=1;
-    static int count;
+    //static int count;
     static char prev[1024];
     char line[8192];
-    static int is_atty;
+    //static int is_atty;
     AVClass* avc= ptr ? *(AVClass**)ptr : NULL;
     if(level > av_log_get_level())
         return;
index 87755784b6df44033933503223f2cf796a00e598..4943394fee5493367fc9a966257170395f094f81 100644 (file)
@@ -491,7 +491,7 @@ std::wstring print_mode(int width, int height, double fps, bool interlaced)
        return boost::lexical_cast<std::wstring>(width) + L"x" + boost::lexical_cast<std::wstring>(height) + (!interlaced ? L"p" : L"i") + fps_ss.str();
 }
 
-bool is_valid_file(const std::wstring filename)
+bool is_valid_file(const std::wstring& filename)
 {                              
        static const std::vector<std::wstring> invalid_exts = boost::assign::list_of(L".png")(L".tga")(L".bmp")(L".jpg")(L".jpeg")(L".gif")(L".tiff")(L".tif")(L".jp2")(L".jpx")(L".j2k")(L".j2c")(L".swf")(L".ct");
        static std::vector<std::wstring>           valid_exts   = boost::assign::list_of(L".m2t")(L".mov")(L".mp4")(L".dv")(L".flv")(L".mpg")(L".wav")(L".mp3")(L".dnxhd")(L".h264")(L".prores");
@@ -528,7 +528,7 @@ bool is_valid_file(const std::wstring filename)
        return av_probe_input_format2(&pb, true, &score) != nullptr;
 }
 
-std::wstring probe_stem(const std::wstring stem)
+std::wstring probe_stem(const std::wstring& stem)
 {
        auto stem2 = boost::filesystem::path(stem);
        auto dir = stem2.parent_path();
index cac1b441e2fb9cace5aa11d87a28efb026bedad2..41f4d416110fb6a766a40bdc879d7af000adf244 100644 (file)
@@ -66,7 +66,7 @@ double read_fps(AVFormatContext& context, double fail_value);
 
 std::wstring print_mode(int width, int height, double fps, bool interlaced);
 
-std::wstring probe_stem(const std::wstring stem);
-bool is_valid_file(const std::wstring filename);
+std::wstring probe_stem(const std::wstring& stem);
+bool is_valid_file(const std::wstring& filename);
 
 }}
\ No newline at end of file
index 9949be7393b5360ea206a6c0866d8094024c8955..7d7e93c8161bd853a5750b782981eaac3b2de0c3 100644 (file)
@@ -863,9 +863,7 @@ bool FlashAxContainer::DrawControl(HDC targetDC)
 {
 //     ATLTRACE(_T("FlashAxContainer::DrawControl\n"));
        DVASPECTINFO aspectInfo = {sizeof(DVASPECTINFO), DVASPECTINFOFLAG_CANOPTIMIZE};
-       HRESULT hr = S_OK;
-
-       hr = m_spViewObject->Draw(DVASPECT_CONTENT, -1, &aspectInfo, NULL, NULL, targetDC, NULL, NULL, NULL, NULL); 
+       HRESULT hr = m_spViewObject->Draw(DVASPECT_CONTENT, -1, &aspectInfo, NULL, NULL, targetDC, NULL, NULL, NULL, NULL); 
        bInvalidRect_ = false;
 /*     const video_format_desc& fmtDesc = video_format_desc::FormatDescriptions[format_];
 
index fabca72ccc4e6e333c95e09114e6b35882c7fba5..274cf98727ccf068be0e18a03afe68df51c3381f 100644 (file)
@@ -56,7 +56,7 @@ namespace caspar {
 namespace flash {
 
 class TimerHelper;
-struct DirtyRect {
+/*struct DirtyRect {
        DirtyRect(LONG l, LONG t, LONG r, LONG b, bool e) : bErase(e), bWhole(false) { 
                rect.left = l;
                rect.top = t;
@@ -74,7 +74,7 @@ struct DirtyRect {
        RECT    rect;
        bool    bErase;
        bool    bWhole;
-};
+};*/
 
 extern _ATL_FUNC_INFO fnInfoFlashCallEvent;
 extern _ATL_FUNC_INFO fnInfoReadyStateChangeEvent;
@@ -273,7 +273,7 @@ private:
        volatile bool bReadyToRender_;
        volatile bool bIsEmpty_;
        volatile bool bHasNewTiming_;
-       std::vector<DirtyRect> bDirtyRects_;
+       //std::vector<DirtyRect> bDirtyRects_;
 
 
        IDirectDraw4Ptr *m_lpDD4;
index a91f2539af5070f31c46946bd40b723ff65635d6..178b9af1f6a2334d1d86b87cfa380685f6799da1 100644 (file)
@@ -106,7 +106,7 @@ template<class SrcView, class DstView>
 void blur(
        const SrcView& src,
        DstView& dst,
-       const std::vector<std::pair<int, int>> motion_trail_coordinates, 
+       const std::vector<std::pair<int, int>>& motion_trail_coordinates, 
        const core::tweener& tweener)
 {
        auto blur_px = motion_trail_coordinates.size();
index 40906e0ae2fb8475a2eb3a615bfe8e9aaeb22357..58ffe83946df6a161255f109782e7e7adc107e6f 100644 (file)
@@ -516,10 +516,10 @@ public:
                                break;
 
                        unsigned long colIndex = 0;
-                       unsigned char length = 0;
+
                        do
                        {
-                               length = 0;
+                               unsigned char length = 0;
 
                                //Get controlbyte
                                char controlByte = static_cast<char>(stream.read_byte());
index 3e0a50e0dab666f3e3ac3f1561689e6da0cfefbb..c8411fd8e21cdaad8d7b31b2f1a7198c8764801a 100644 (file)
@@ -343,7 +343,7 @@ spl::shared_ptr<core::frame_producer> create_psd_scene_producer(const spl::share
                                std::shared_ptr<core::frame_producer> layer_producer;
                                if((*it)->is_solid())
                                {
-                                       layer_producer = layer_producer = core::create_const_producer(core::create_color_frame(it->get(), frame_factory, (*it)->solid_color().to_uint32()), (*it)->bitmap()->width(), (*it)->bitmap()->height());
+                                       layer_producer = core::create_const_producer(core::create_color_frame(it->get(), frame_factory, (*it)->solid_color().to_uint32()), (*it)->bitmap()->width(), (*it)->bitmap()->height());
                                }
                                else if((*it)->bitmap())
                                {
index a20b1e01a7928d9c69289e35e0703bcb25048175..12e105e505f7ac163b75c2e6f696c26ad52647a8 100644 (file)
@@ -492,7 +492,7 @@ bool MixerCommand::DoExecute()
                {
                        auto blend_str = parameters().at(1);                                                            
                        int layer = layer_index();
-                       channel()->mixer().set_blend_mode(layer_index(), get_blend_mode(blend_str));    
+                       channel()->mixer().set_blend_mode(layer, get_blend_mode(blend_str));    
                }
                else if(boost::iequals(parameters()[0], L"MASTERVOLUME"))
                {
@@ -792,8 +792,6 @@ bool LoadbgCommand::DoExecute()
 {
        transition_info transitionInfo;
        
-       bool bLoop = false;
-
        // TRANSITION
 
        std::wstring message;
@@ -1059,7 +1057,6 @@ bool CGCommand::DoExecuteAdd() {
        }
 
        const TCHAR* pDataString = 0;
-       std::wstringstream data;
        std::wstring dataFromFile;
        if(parameters().size() > dataIndex) 
        {       //read data
index 2ca28425d41e8edf6d25cde897a34563cec2b4fc..1f32923758e858f153886f97a06a3dbdc11232c3 100644 (file)
@@ -297,7 +297,7 @@ public:
 class ThumbnailCommand : public AMCPCommandBase<1>
 {
 public:
-       ThumbnailCommand::ThumbnailCommand(IO::ClientInfoPtr client, std::shared_ptr<core::thumbnail_generator> thumb_gen) : AMCPCommandBase(client), thumb_gen_(thumb_gen) 
+       ThumbnailCommand(IO::ClientInfoPtr client, std::shared_ptr<core::thumbnail_generator> thumb_gen) : AMCPCommandBase(client), thumb_gen_(thumb_gen) 
        {}
        std::wstring print() const { return L"ThumbnailCommand";}
        bool DoExecute();
index c44ddfda39be4ae3f48c4ea4839f4a9e6057a821..1afbefaf87dca08ff60ce2b80eda70bb945e07f4 100644 (file)
@@ -57,10 +57,12 @@ public:
                TitleHolder() : titleName(L""), pframe_producer(core::frame_producer::empty())  {}
                TitleHolder(const std::wstring& name, spl::shared_ptr<core::frame_producer> pFP) : titleName(name), pframe_producer(pFP) {}
                TitleHolder(const TitleHolder& th) : titleName(th.titleName), pframe_producer(th.pframe_producer) {}
-               const TitleHolder& operator=(const TitleHolder& th) 
+               TitleHolder& operator=(const TitleHolder& th) 
                {
                        titleName = th.titleName;
                        pframe_producer = th.pframe_producer;
+
+                       return *this;
                }
                bool operator==(const TitleHolder& rhs) 
                {
index cca1e13538a733db51fbc7bd7e8bbd105343f619..7f1efeaf3e24d9bbd70467775cff97bacf3106a9 100644 (file)
@@ -631,12 +631,12 @@ void ReceivedMessage::Init( const char *message, unsigned long size )
                     case BLOB_TYPE_TAG:
                         {
                             if( argument + 4 > end )
-                                MalformedMessageException( "arguments exceed message size" );
+                                throw MalformedMessageException( "arguments exceed message size" );
                                 
                             uint32 blobSize = ToUInt32( argument );
                             argument = argument + 4 + RoundUp4( (unsigned long)blobSize );
                             if( argument > end )
-                                MalformedMessageException( "arguments exceed message size" );
+                                throw MalformedMessageException( "arguments exceed message size" );
                         }
                         break;
                         
index d7225d5b148d82b78e8d6dfabcb50c2e2ab65fd6..2905e8b97903b857d9d5b75c83608425764fba9b 100644 (file)
@@ -126,7 +126,7 @@ public:
                service_.dispatch([=] { stop(); });
        }
 
-       void add_lifecycle_bound_object(const std::wstring& key, const std::shared_ptr<void> lifecycle_bound)
+       void add_lifecycle_bound_object(const std::wstring& key, const std::shared_ptr<void>& lifecycle_bound)
        {
                //thread-safe tbb_concurrent_hash_map
                lifecycle_bound_objects_.insert(std::pair<std::wstring, std::shared_ptr<void>>(key, lifecycle_bound));