]> git.sesse.net Git - casparcg/commitdiff
2.1.0: Fixed SEEK on PAUSE.
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Mon, 26 Mar 2012 18:51:11 +0000 (18:51 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Mon, 26 Mar 2012 18:51:11 +0000 (18:51 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.1.0@2756 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

core/producer/separated/separated_producer.cpp
core/producer/transition/transition_producer.cpp
modules/ffmpeg/producer/ffmpeg_producer.cpp
modules/ffmpeg/producer/input/input.cpp
shell/casparcg.config

index 9e20124b6f36656f81a6fd0d5b3789714a56e863..8c2b263bd72f285018f4fee4493abba7f0905fe6 100644 (file)
@@ -83,6 +83,11 @@ public:
                \r
                return frame;\r
        }\r
+\r
+       draw_frame last_frame() const\r
+       {\r
+               return draw_frame::mask(fill_producer_->last_frame(), key_producer_->last_frame());\r
+       }\r
                                \r
        uint32_t nb_frames() const override\r
        {\r
index 26946f40bc58669030352bdb8d4c86fd1cfc07de..da8390736a3a7bb14c5e58475c39fe26916a924c 100644 (file)
@@ -110,6 +110,14 @@ public:
 \r
                return compose(dest, source);\r
        }\r
+\r
+       draw_frame last_frame() const override\r
+       {\r
+               if(current_frame_ >= info_.duration)\r
+                       return dest_producer_->last_frame();\r
+\r
+               return frame_producer_base::last_frame();\r
+       }\r
                        \r
        uint32_t nb_frames() const override\r
        {\r
@@ -138,7 +146,7 @@ public:
 \r
        // transition_producer\r
                                                \r
-       draw_frame compose(draw_frame dest_frame, draw_frame src_frame) \r
+       draw_frame compose(draw_frame dest_frame, draw_frame src_frame) const\r
        {       \r
                if(info_.type == transition_type::cut)          \r
                        return src_frame;\r
index 3f770ae0660736a55806ab5f4dffb30a9c44531f..e2eca62b62ec3541415050c8027c789206fb68c3 100644 (file)
@@ -356,17 +356,16 @@ public:
                muxer_.clear();\r
                \r
                // BEGIN HACK: There is no way to flush yadif. Need to poll 2 frames.\r
-               for(int n = 0; n < 25 && file_frame_number() != target+2; ++n)\r
+               for(int n = 0; n < 25 && file_frame_number() != target+3; ++n)\r
                {\r
                        decode_next_frame();\r
                        if(!muxer_.empty())\r
+                       {\r
+                               last_frame_ = std::move(muxer_.front());\r
                                muxer_.pop();\r
+                       }\r
                }\r
-               // END HACK\r
-\r
-               decode_next_frame();\r
-\r
-               last_frame_ = !muxer_.empty() ? muxer_.front() : last_frame_;                   \r
+               // END HACK             \r
        }\r
 \r
        std::wstring print_mode() const\r
index 1ac27b972a91722cbf70e04a899322fea66246ea..e24a1b5478f67698c695f01eb93b1fab2eb8f643 100644 (file)
@@ -28,6 +28,7 @@
 \r
 #include <common/diagnostics/graph.h>\r
 #include <common/executor.h>\r
+#include <common/lock.h>\r
 #include <common/except.h>\r
 #include <common/log.h>\r
 \r
@@ -180,11 +181,15 @@ struct input::impl : boost::noncopyable
 \r
        void seek(uint32_t target)\r
        {\r
-               seek_target_ = target;\r
-               video_stream_.clear();\r
-               audio_stream_.clear();\r
+               {\r
+                       boost::lock_guard<boost::mutex> lock(mutex_);\r
+\r
+                       seek_target_ = target;\r
+                       video_stream_.clear();\r
+                       audio_stream_.clear();\r
+                       eof_ = false;\r
+               }\r
 \r
-               eof_ = false;\r
                cond_.notify_one();\r
        }\r
                \r
@@ -291,16 +296,19 @@ private:
 \r
                while(is_running_)\r
                {\r
-                       boost::unique_lock<boost::mutex> lock(mutex_);\r
 \r
                        try\r
                        {\r
-                               tick();\r
-\r
                                boost::this_thread::sleep(boost::posix_time::milliseconds(1));\r
                                \r
-                               while((full() || eof_) && is_running_)\r
-                                       cond_.wait(lock);\r
+                               {\r
+                                       boost::unique_lock<boost::mutex> lock(mutex_);\r
+\r
+                                       while((full() || eof_) && is_running_)\r
+                                               cond_.wait(lock);\r
+                                       \r
+                                       tick();\r
+                               }\r
                        }\r
                        catch(...)\r
                        {\r
index 017900ec906c9a16e3017f327bafcb8affdeb199..efbe19a308709d0e399d0df16f0f6b31bd1e89a7 100644 (file)
@@ -13,7 +13,7 @@
   </flash>\r
   <channels>\r
     <channel>\r
-      <video-mode>1080p5000</video-mode>\r
+      <video-mode>PAL</video-mode>\r
       <consumers>\r
         <screen>\r
           <device>1</device>\r