]> git.sesse.net Git - casparcg/commitdiff
2.1.0: -Removed LTCG for faster compiling. -Removed audio truncation with mismatch...
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Sun, 18 Mar 2012 19:16:33 +0000 (19:16 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Sun, 18 Mar 2012 19:16:33 +0000 (19:16 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.1.0@2665 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

20 files changed:
accelerator/accelerator.vcxproj
common/common.vcxproj
core/core.vcxproj
modules/bluefish/bluefish.vcxproj
modules/decklink/decklink.vcxproj
modules/decklink/producer/decklink_producer.cpp
modules/ffmpeg/ffmpeg.vcxproj
modules/ffmpeg/producer/audio/audio_decoder.cpp
modules/ffmpeg/producer/ffmpeg_producer.cpp
modules/ffmpeg/producer/filter/parallel_yadif.cpp
modules/ffmpeg/producer/muxer/frame_muxer.cpp
modules/ffmpeg/producer/video/video_decoder.cpp
modules/flash/flash.vcxproj
modules/image/image.vcxproj
modules/oal/oal.vcxproj
modules/reroute/reroute.vcxproj
modules/screen/screen.vcxproj
protocol/protocol.vcxproj
shell/casparcg.config
shell/shell.vcxproj

index 461c648cab807540e32db5771be26738632cca9d..3f3ea9d80a607a87a108278787a26a7feb60a634 100644 (file)
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <WholeProgramOptimization>true</WholeProgramOptimization>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <OmitFramePointers>true</OmitFramePointers>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
index acda0634379ee333c6c3e2a168b188a7b54053ee..e1a822c25cf100f0ded5a9323d0248885561bcf5 100644 (file)
       <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
       <RuntimeTypeInfo>true</RuntimeTypeInfo>\r
-      <WholeProgramOptimization>true</WholeProgramOptimization>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
       <ForcedIncludeFiles>compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
       </Command>\r
     </PreBuildEvent>\r
     <Lib>\r
-      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+      <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>\r
     </Lib>\r
   </ItemDefinitionGroup>\r
   <ItemGroup>\r
index cec7204420b300c6c7d16d9bdf69a1eabf459f23..5287015a514975e015dec8fbe24a1cf3bd24b1c5 100644 (file)
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <WholeProgramOptimization>true</WholeProgramOptimization>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <OmitFramePointers>true</OmitFramePointers>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
       </Command>\r
     </PostBuildEvent>\r
     <Lib>\r
-      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+      <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>\r
     </Lib>\r
   </ItemDefinitionGroup>\r
   <ItemGroup>\r
index 629e3c33b78441e263426de99fb09b2d232e24c8..1358048d35a84a0d4df8c59836ee09c8d56cd8f2 100644 (file)
@@ -96,7 +96,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <WholeProgramOptimization>true</WholeProgramOptimization>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <OmitFramePointers>true</OmitFramePointers>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
     <Lib>\r
       <AdditionalDependencies>\r
       </AdditionalDependencies>\r
-      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+      <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>\r
     </Lib>\r
   </ItemDefinitionGroup>\r
   <ItemGroup>\r
index d6cfa03dd3e19f0de394807e93101df4601b5880..c2c493b1b638ae3e1fbdfa673ab3811a9a8cdc99 100644 (file)
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;_VC80_UPGRADE=0x0710;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <WholeProgramOptimization>true</WholeProgramOptimization>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <OmitFramePointers>true</OmitFramePointers>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
       </Command>\r
     </PostBuildEvent>\r
     <Lib>\r
-      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+      <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>\r
     </Lib>\r
   </ItemDefinitionGroup>\r
   <ItemGroup>\r
index e10a45939cb92cfd22360bb14aca8fcbbf9cc642..fabe974cb4ca27aa1f4948be3a60a2ea58121d78 100644 (file)
@@ -387,10 +387,7 @@ spl::shared_ptr<core::frame_producer> create_producer(const spl::shared_ptr<core
        auto filter_str         = get_param(L"FILTER", params);         \r
        auto length                     = get_param(L"LENGTH", params, std::numeric_limits<uint32_t>::max());   \r
        auto in_format_desc = core::video_format_desc(get_param(L"FORMAT", params, L"INVALID"));\r
-       \r
-       boost::replace_all(filter_str, L"DEINTERLACE", L"YADIF=0:-1");\r
-       boost::replace_all(filter_str, L"DEINTERLACE_BOB", L"YADIF=1:-1");\r
-       \r
+               \r
        if(in_format_desc.format == core::video_format::invalid)\r
                in_format_desc = out_format_desc;\r
                        \r
index 69d8c52e9b39ffe4cbc1e8cfb18f4d0e6298be87..31e2bb6bfde5b1fe4bb44cad83f4fed19ed06920 100644 (file)
@@ -93,7 +93,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;_VC80_UPGRADE=0x0710;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <WholeProgramOptimization>true</WholeProgramOptimization>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <OmitFramePointers>true</OmitFramePointers>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
       </Command>\r
     </PostBuildEvent>\r
     <Lib>\r
-      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+      <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>\r
     </Lib>\r
   </ItemDefinitionGroup>\r
   <ItemGroup>\r
index 0c21baedc7161663a36cdcc2b66f459c3a5dcff5..349b71b9d84953f0168a8ea16ec3df8687b9f46e 100644 (file)
@@ -88,7 +88,7 @@ public:
 \r
        void push(const std::shared_ptr<AVPacket>& packet)\r
        {                       \r
-               if(!packet)\r
+               if(!packet || !codec_context_)\r
                        return;\r
 \r
                if(packet->stream_index == index_ || packet->data == nullptr)\r
@@ -97,32 +97,27 @@ public:
        \r
        std::shared_ptr<core::audio_buffer> poll()\r
        {\r
+               if(!codec_context_)\r
+                       return empty_audio();\r
+\r
                if(packets_.empty())\r
                        return nullptr;\r
                                \r
                auto packet = packets_.front();\r
                \r
-               if(!codec_context_)             \r
+               if(packet->data == nullptr)\r
                {\r
                        packets_.pop();\r
-                       return packet->data == nullptr ? flush_audio() : empty_audio();\r
+                       avcodec_flush_buffers(codec_context_.get());\r
+                       return nullptr;\r
                }\r
-               else\r
-               {\r
-                       if(packet->data == nullptr)\r
-                       {\r
-                               packets_.pop();\r
-                               avcodec_flush_buffers(codec_context_.get());\r
-                               return flush_audio();\r
-                       }\r
 \r
-                       auto audio = decode(*packet);\r
+               auto audio = decode(*packet);\r
 \r
-                       if(packet->size == 0)                                   \r
-                               packets_.pop();\r
+               if(packet->size == 0)                                   \r
+                       packets_.pop();\r
 \r
-                       return audio;\r
-               }\r
+               return audio;\r
        }\r
 \r
        std::shared_ptr<core::audio_buffer> decode(AVPacket& pkt)\r
@@ -155,7 +150,7 @@ public:
 \r
        bool ready() const\r
        {\r
-               return !packets_.empty();\r
+               return !codec_context_ || !packets_.empty();\r
        }\r
        \r
        void clear()\r
index 0fae2c58549f3f59b524b75f9c004b1ad7212132..4b91b047e07267fc794455c65faab6599f04b521 100644 (file)
@@ -420,9 +420,6 @@ spl::shared_ptr<core::frame_producer> create_producer(const spl::shared_ptr<core
        auto start              = get_param(L"START", params, get_param(L"SEEK", params, static_cast<uint32_t>(0)));\r
        auto length             = get_param(L"LENGTH", params, std::numeric_limits<uint32_t>::max());\r
        auto filter_str = get_param(L"FILTER", params, L"");    \r
-               \r
-       boost::replace_all(filter_str, L"DEINTERLACE", L"YADIF=0:-1");\r
-       boost::replace_all(filter_str, L"DEINTERLACE_BOB", L"YADIF=1:-1");\r
        \r
        return spl::make_shared_ptr(std::make_shared<ffmpeg_producer>(frame_factory, format_desc, filename, filter_str, loop, start, length));\r
 }\r
index 0facf6020018644a2bcaaaca31215c3ebf7b4a46..70bc454863ac9040cac4463457fe12702691fc94 100644 (file)
@@ -72,11 +72,8 @@ struct parallel_yadif_context
                int mode;\r
        };\r
 \r
-       arg     args[4096];\r
-       int     index;\r
-       int last_index;\r
-\r
-       parallel_yadif_context() : index(0){}\r
+       int                              size;\r
+       std::vector<arg> args;\r
 };\r
 \r
 void (*org_yadif_filter_line)(uint8_t *dst, uint8_t *prev, uint8_t *cur, uint8_t *next, int w, int prefs, int mrefs, int parity, int mode) = 0;\r
@@ -84,16 +81,16 @@ void (*org_yadif_filter_line)(uint8_t *dst, uint8_t *prev, uint8_t *cur, uint8_t
 void parallel_yadif_filter_line(parallel_yadif_context& ctx, uint8_t *dst, uint8_t *prev, uint8_t *cur, uint8_t *next, int w, int prefs, int mrefs, int parity, int mode)\r
 {\r
        parallel_yadif_context::arg arg = {dst, prev, cur, next, w, prefs, mrefs, parity, mode};\r
-       ctx.args[ctx.index++] = arg;\r
+       ctx.args.push_back(arg);\r
        \r
-       if(ctx.index == ctx.last_index)\r
+       if(ctx.args.size() == ctx.size)\r
        {               \r
-               tbb::parallel_for(tbb::blocked_range<size_t>(0, ctx.index), [=](const tbb::blocked_range<size_t>& r)\r
+               tbb::parallel_for(tbb::blocked_range<size_t>(0, ctx.args.size()), [=](const tbb::blocked_range<size_t>& r)\r
                {\r
                        for(auto n = r.begin(); n != r.end(); ++n)\r
                                org_yadif_filter_line(ctx.args[n].dst, ctx.args[n].prev, ctx.args[n].cur, ctx.args[n].next, ctx.args[n].w, ctx.args[n].prefs, ctx.args[n].mrefs, ctx.args[n].parity, ctx.args[n].mode);\r
                });\r
-               ctx.index = 0;\r
+               ctx.args.clear();\r
        }\r
 }\r
 \r
@@ -145,11 +142,11 @@ std::shared_ptr<void> make_parallel_yadif(AVFilterContext* ctx)
                while(index < sizeof(fs)/sizeof(fs[0]) && fs[index] != func)\r
                        ++index;\r
 \r
-               ctxs[index].last_index = 0;\r
+               ctxs[index].size = 0;\r
                for (int y = 0; y < ctx->inputs[0]->h; y++)\r
                {\r
             if ((y ^ yadif->parity) & 1)\r
-                               ++ctxs[index].last_index;\r
+                               ++ctxs[index].size;\r
                }\r
 \r
                yadif->filter_line = func;\r
index 986d69b5ce3b741afce3e4de741239a45355a3ab..b779e42d34f97d770d2367db8d79aef3538b5bfe 100644 (file)
@@ -67,8 +67,8 @@ namespace caspar { namespace ffmpeg {
        \r
 struct frame_muxer::impl : boost::noncopyable\r
 {      \r
-       std::queue<std::queue<core::mutable_frame>>             video_streams_;\r
-       std::queue<core::audio_buffer>                                  audio_streams_;\r
+       std::queue<core::mutable_frame>                                 video_stream_;\r
+       core::audio_buffer                                                              audio_stream_;\r
        std::queue<draw_frame>                                                  frame_buffer_;\r
        display_mode                                                                    display_mode_;\r
        const double                                                                    in_fps_;\r
@@ -88,99 +88,64 @@ struct frame_muxer::impl : boost::noncopyable
                , audio_cadence_(format_desc_.audio_cadence)\r
                , frame_factory_(frame_factory)\r
                , filter_str_(filter_str)\r
-       {\r
-               video_streams_.push(std::queue<core::mutable_frame>());\r
-               audio_streams_.push(core::audio_buffer());\r
-               \r
+       {               \r
                // Note: Uses 1 step rotated cadence for 1001 modes (1602, 1602, 1601, 1602, 1601)\r
                // This cadence fills the audio mixer most optimally.\r
                boost::range::rotate(audio_cadence_, std::end(audio_cadence_)-1);\r
        }\r
 \r
-       void push(const std::shared_ptr<AVFrame>& video_frame)\r
+       void push(const std::shared_ptr<AVFrame>& video)\r
        {               \r
-               if(!video_frame)\r
-               {\r
-                       merge();\r
-                       return;\r
-               }\r
-\r
-               if(video_frame == flush_video())                \r
-                       video_streams_.push(std::queue<core::mutable_frame>());                         \r
-               else if(video_frame == empty_video())\r
+               if(video == empty_video())\r
                {\r
                        auto empty_frame = frame_factory_->create_frame(this, core::pixel_format_desc(core::pixel_format::invalid));\r
-                       video_streams_.back().push(std::move(empty_frame));\r
+                       video_stream_.push(std::move(empty_frame));\r
                        display_mode_ = display_mode::simple;\r
                }\r
-               else\r
+               else if(video)\r
                {\r
                        if(display_mode_ == display_mode::invalid)\r
-                               update_display_mode(video_frame);\r
+                               update_display_mode(video);\r
                                \r
-                       filter_.push(video_frame);\r
+                       filter_.push(video);\r
                        BOOST_FOREACH(auto& av_frame, filter_.poll_all())                       \r
-                               video_streams_.back().push(make_frame(this, av_frame, format_desc_.fps, *frame_factory_));                      \r
+                               video_stream_.push(make_frame(this, av_frame, format_desc_.fps, *frame_factory_));                      \r
                }\r
 \r
-               if(video_streams_.back().size() > 32)\r
-                       BOOST_THROW_EXCEPTION(invalid_operation() << source_info("frame_muxer") << msg_info("video-stream overflow. This can be caused by incorrect frame-rate. Check clip meta-data."));\r
-               \r
                merge();\r
        }\r
 \r
        void push(const std::shared_ptr<core::audio_buffer>& audio)\r
        {\r
-               if(!audio)\r
-               {\r
-                       merge();\r
-                       return;\r
-               }\r
-\r
-               if(audio == flush_audio())                      \r
-                       audio_streams_.push(core::audio_buffer());                              \r
-               else if(audio == empty_audio())         \r
-                       boost::range::push_back(audio_streams_.back(), core::audio_buffer(audio_cadence_.front(), 0));          \r
-               else            \r
-                       boost::range::push_back(audio_streams_.back(), *audio);         \r
-\r
-               if(audio_streams_.back().size() > static_cast<size_t>(32*audio_cadence_.front()))\r
-                       BOOST_THROW_EXCEPTION(invalid_operation() << source_info("frame_muxer") << msg_info("audio-stream overflow. This can be caused by incorrect frame-rate. Check clip meta-data."));\r
+               if(audio == empty_audio())              \r
+                       boost::range::push_back(audio_stream_, core::audio_buffer(audio_cadence_.front(), 0));          \r
+               else if(audio)  \r
+                       boost::range::push_back(audio_stream_, *audio);         \r
 \r
                merge();\r
        }\r
        \r
        bool video_ready() const\r
-       {               \r
-               return video_streams_.size() > 1 || (video_streams_.size() >= audio_streams_.size() && video_ready2());\r
-       }\r
-       \r
-       bool audio_ready() const\r
-       {\r
-               return audio_streams_.size() > 1 || (audio_streams_.size() >= video_streams_.size() && audio_ready2());\r
-       }\r
-\r
-       bool video_ready2() const\r
        {               \r
                switch(display_mode_)\r
                {\r
                case display_mode::deinterlace_bob_reinterlace:                                 \r
                case display_mode::interlace:   \r
                case display_mode::half:\r
-                       return video_streams_.front().size() >= 2;\r
+                       return video_stream_.size() >= 2;\r
                default:                                                                                \r
-                       return video_streams_.front().size() >= 1;\r
+                       return video_stream_.size() >= 1;\r
                }\r
        }\r
        \r
-       bool audio_ready2() const\r
+       bool audio_ready() const\r
        {\r
                switch(display_mode_)\r
                {\r
                case display_mode::duplicate:                                   \r
-                       return audio_streams_.front().size()/2 >= static_cast<size_t>(audio_cadence_.front());\r
+                       return audio_stream_.size()/2 >= static_cast<size_t>(audio_cadence_.front());\r
                default:                                                                                \r
-                       return audio_streams_.front().size() >= static_cast<size_t>(audio_cadence_.front());\r
+                       return audio_stream_.size() >= static_cast<size_t>(audio_cadence_.front());\r
                }\r
        }\r
 \r
@@ -201,78 +166,67 @@ struct frame_muxer::impl : boost::noncopyable
                \r
        void merge()\r
        {\r
-               if(video_streams_.size() > 1 && audio_streams_.size() > 1 && (!video_ready2() || !audio_ready2()))\r
-               {\r
-                       if(!video_streams_.front().empty() || !audio_streams_.front().empty())\r
-                               CASPAR_LOG(trace) << "Truncating: " << video_streams_.front().size() << L" video-frames, " << audio_streams_.front().size() << L" audio-samples.";\r
+               if(video_ready() && audio_ready() && display_mode_ != display_mode::invalid)\r
+               {                               \r
+                       auto frame1                     = pop_video();\r
+                       frame1.audio_data()     = pop_audio();\r
 \r
-                       video_streams_.pop();\r
-                       audio_streams_.pop();\r
-               }\r
-\r
-               if(!video_ready2() || !audio_ready2() || display_mode_ == display_mode::invalid)\r
-                       return;\r
-                               \r
-               auto frame1                             = pop_video();\r
-               frame1.audio_data()     = pop_audio();\r
-\r
-               switch(display_mode_)\r
-               {\r
-               case display_mode::simple:                                              \r
-               case display_mode::deinterlace_bob:                             \r
-               case display_mode::deinterlace: \r
-                       {\r
-                               frame_buffer_.push(core::draw_frame(std::move(frame1)));\r
-                               break;\r
-                       }\r
-               case display_mode::interlace:                                   \r
-               case display_mode::deinterlace_bob_reinterlace: \r
-                       {                               \r
-                               auto frame2 = pop_video();\r
-\r
-                               frame_buffer_.push(core::draw_frame::interlace(\r
-                                       core::draw_frame(std::move(frame1)),\r
-                                       core::draw_frame(std::move(frame2)),\r
-                                       format_desc_.field_mode));      \r
-                               break;\r
-                       }\r
-               case display_mode::duplicate:   \r
+                       switch(display_mode_)\r
                        {\r
-                               boost::range::push_back(frame1.audio_data(), pop_audio());\r
-\r
-                               auto draw_frame = core::draw_frame(std::move(frame1));\r
-                               frame_buffer_.push(draw_frame);\r
-                               frame_buffer_.push(draw_frame);\r
-                               break;\r
-                       }\r
-               case display_mode::half:        \r
-                       {                               \r
-                               pop_video(); // Throw away\r
-\r
-                               frame_buffer_.push(core::draw_frame(std::move(frame1)));\r
-                               break;\r
+                       case display_mode::simple:                                              \r
+                       case display_mode::deinterlace_bob:                             \r
+                       case display_mode::deinterlace: \r
+                               {\r
+                                       frame_buffer_.push(core::draw_frame(std::move(frame1)));\r
+                                       break;\r
+                               }\r
+                       case display_mode::interlace:                                   \r
+                       case display_mode::deinterlace_bob_reinterlace: \r
+                               {                               \r
+                                       auto frame2 = pop_video();\r
+\r
+                                       frame_buffer_.push(core::draw_frame::interlace(\r
+                                               core::draw_frame(std::move(frame1)),\r
+                                               core::draw_frame(std::move(frame2)),\r
+                                               format_desc_.field_mode));      \r
+                                       break;\r
+                               }\r
+                       case display_mode::duplicate:   \r
+                               {\r
+                                       boost::range::push_back(frame1.audio_data(), pop_audio());\r
+\r
+                                       auto draw_frame = core::draw_frame(std::move(frame1));\r
+                                       frame_buffer_.push(draw_frame);\r
+                                       frame_buffer_.push(draw_frame);\r
+                                       break;\r
+                               }\r
+                       case display_mode::half:        \r
+                               {                               \r
+                                       pop_video(); // Throw away\r
+\r
+                                       frame_buffer_.push(core::draw_frame(std::move(frame1)));\r
+                                       break;\r
+                               }\r
+                       default:\r
+                               BOOST_THROW_EXCEPTION(invalid_operation());\r
                        }\r
-               default:\r
-                       BOOST_THROW_EXCEPTION(invalid_operation());\r
                }\r
        }\r
        \r
        core::mutable_frame pop_video()\r
        {\r
-               auto frame = std::move(video_streams_.front().front());\r
-               video_streams_.front().pop();           \r
+               auto frame = std::move(video_stream_.front());\r
+               video_stream_.pop();            \r
                return std::move(frame);\r
        }\r
 \r
        core::audio_buffer pop_audio()\r
        {\r
-               CASPAR_VERIFY(audio_streams_.front().size() >= static_cast<size_t>(audio_cadence_.front()));\r
-\r
-               auto begin = audio_streams_.front().begin();\r
+               auto begin = audio_stream_.begin();\r
                auto end   = begin + audio_cadence_.front();\r
 \r
                core::audio_buffer samples(begin, end);\r
-               audio_streams_.front().erase(begin, end);\r
+               audio_stream_.erase(begin, end);\r
                \r
                boost::range::rotate(audio_cadence_, std::begin(audio_cadence_)+1);\r
 \r
@@ -349,15 +303,13 @@ struct frame_muxer::impl : boost::noncopyable
 \r
        void clear()\r
        {\r
-               while(!video_streams_.empty())\r
-                       video_streams_.pop();           \r
-               while(!audio_streams_.empty())\r
-                       audio_streams_.pop();\r
+               while(!video_stream_.empty())\r
+                       video_stream_.pop();    \r
+\r
+               audio_stream_.clear();\r
+\r
                while(!frame_buffer_.empty())\r
                        frame_buffer_.pop();\r
-\r
-               video_streams_.push(std::queue<core::mutable_frame>());\r
-               audio_streams_.push(core::audio_buffer());\r
        }\r
 };\r
 \r
index 444300689e9df8500da6148ea3527d15103bf840..3442e2ce74ac7ef21c3a4b879ca83e71874e4d08 100644 (file)
@@ -89,7 +89,7 @@ public:
 \r
        void push(const std::shared_ptr<AVPacket>& packet)\r
        {\r
-               if(!packet)\r
+               if(!packet || !codec_context_)\r
                        return;\r
 \r
                if(packet->stream_index == index_ || packet->data == nullptr)\r
@@ -98,36 +98,30 @@ public:
 \r
        std::shared_ptr<AVFrame> poll()\r
        {               \r
+               if(!codec_context_)\r
+                       return empty_video();\r
+\r
                if(packets_.empty())\r
                        return nullptr;\r
                \r
                auto packet = packets_.front();\r
                \r
-               if(!codec_context_)             \r
-               {\r
-                       packets_.pop();\r
-                       return packet->data == nullptr ? flush_video() : empty_video();\r
-               }\r
-               else\r
-               {\r
-                       if(packet->data == nullptr)\r
-                       {                       \r
-                               if(codec_context_->codec->capabilities & CODEC_CAP_DELAY)\r
-                               {\r
-                                       auto video = decode(*packet);\r
-                                       if(video)\r
-                                               return video;\r
-                               }\r
-                                       \r
-                               packets_.pop();\r
-                               avcodec_flush_buffers(codec_context_.get());                            \r
-                               return flush_video();   \r
+               if(packet->data == nullptr)\r
+               {                       \r
+                       if(codec_context_->codec->capabilities & CODEC_CAP_DELAY)\r
+                       {\r
+                               auto video = decode(*packet);\r
+                               if(video)\r
+                                       return video;\r
                        }\r
-                       \r
+                                       \r
                        packets_.pop();\r
-                       return decode(*packet);\r
+                       avcodec_flush_buffers(codec_context_.get());                            \r
+                       return nullptr; \r
                }\r
-               \r
+                       \r
+               packets_.pop();\r
+               return decode(*packet);         \r
        }\r
 \r
        std::shared_ptr<AVFrame> decode(AVPacket& pkt)\r
@@ -163,7 +157,7 @@ public:
        \r
        bool ready() const\r
        {\r
-               return !packets_.empty();\r
+               return !codec_context_ || !packets_.empty();\r
        }\r
 \r
        void clear()\r
index be5024c2fc6b53862463fc9482b2af86f0466f6c..c8de982f8728169b18182cf9fd536ad6ed653b05 100644 (file)
@@ -93,7 +93,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;_VC80_UPGRADE=0x0710;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <WholeProgramOptimization>true</WholeProgramOptimization>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <OmitFramePointers>true</OmitFramePointers>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
       </Command>\r
     </PostBuildEvent>\r
     <Lib>\r
-      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+      <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>\r
     </Lib>\r
   </ItemDefinitionGroup>\r
   <ItemGroup>\r
index 42dc3146a73e5e6c707f65c3aed05a3848eb4fa9..4051168ecf652c76121557b723cc60699476fe7b 100644 (file)
@@ -97,7 +97,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;FREEIMAGE_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <WholeProgramOptimization>true</WholeProgramOptimization>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <OmitFramePointers>true</OmitFramePointers>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
       </Command>\r
     </PostBuildEvent>\r
     <Lib>\r
-      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+      <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>\r
     </Lib>\r
   </ItemDefinitionGroup>\r
   <ItemGroup>\r
index 100fb019ac5b63b4b9b4173f612b4d9d3e98a4f2..5e85425ae9960461cdd4e2310e3614ab136a0435 100644 (file)
@@ -93,7 +93,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;_VC80_UPGRADE=0x0710;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <WholeProgramOptimization>true</WholeProgramOptimization>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <OmitFramePointers>true</OmitFramePointers>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
       </Command>\r
     </PostBuildEvent>\r
     <Lib>\r
-      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+      <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>\r
     </Lib>\r
   </ItemDefinitionGroup>\r
   <ItemGroup>\r
index 7d0d9c4a58e92c197d41cd38422fa80e1699a79d..cb07b3bfee6c0d263896d038e7bc7e369059345f 100644 (file)
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <WholeProgramOptimization>true</WholeProgramOptimization>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <OmitFramePointers>true</OmitFramePointers>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
       </Command>\r
     </PostBuildEvent>\r
     <Lib>\r
-      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+      <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>\r
     </Lib>\r
   </ItemDefinitionGroup>\r
   <ItemGroup>\r
index b3447c4518e1389a7ccb7dee087604f568ccae5c..6f6666b296a4914568d18a040b486af6c978ce56 100644 (file)
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <WholeProgramOptimization>true</WholeProgramOptimization>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <OmitFramePointers>true</OmitFramePointers>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
       </Command>\r
     </PostBuildEvent>\r
     <Lib>\r
-      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+      <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>\r
     </Lib>\r
   </ItemDefinitionGroup>\r
   <ItemGroup>\r
index 3c2a6a0a5b46799e143cbf30ad31bc4695dd408f..27f37eeea7ec7cbfd289f7e81963e47599d200a7 100644 (file)
       <ForcedIncludeFiles>common/compiler/vs/disable_silly_warnings.h</ForcedIncludeFiles>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
     </ClCompile>\r
     <Lib>\r
-      <LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>\r
+      <LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>\r
     </Lib>\r
   </ItemDefinitionGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
index cae8e0e7c380facf99c150880ef715fa23b6f44b..a27273683df42f6a5426492eb20bbd0d14a7b3be 100644 (file)
@@ -18,6 +18,7 @@
         <screen>\r
           <auto-deinterlace>false</auto-deinterlace>\r
         </screen>\r
+        <system-audio></system-audio>\r
       </consumers>\r
     </channel>\r
   </channels>\r
index 1b2e3df097dbff1e19b5a29de9d1472db1b5d2e2..0731a1bc8f70e66c7c025340f5a806abf71c64d6 100644 (file)
@@ -196,7 +196,7 @@ copy "$(ProjectDir)casparcg.config" "$(OutDir)"</Command>
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
       <MultiProcessorCompilation>true</MultiProcessorCompilation>\r
       <PreprocessorDefinitions>TBB_USE_CAPTURED_EXCEPTION=0;NDEBUG;COMPILE_RELEASE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <WholeProgramOptimization>true</WholeProgramOptimization>\r
+      <WholeProgramOptimization>false</WholeProgramOptimization>\r
       <TreatWarningAsError>true</TreatWarningAsError>\r
       <OmitFramePointers>true</OmitFramePointers>\r
       <FloatingPointModel>Fast</FloatingPointModel>\r
@@ -212,6 +212,7 @@ copy "$(ProjectDir)casparcg.config" "$(OutDir)"</Command>
       <SubSystem>Console</SubSystem>\r
       <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
       <MapExports>false</MapExports>\r
+      <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>\r
     </Link>\r
     <PostBuildEvent>\r
       <Command>copy "$(SolutionDir)dependencies64\ffmpeg\bin\*.dll" "$(OutDir)"\r