]> git.sesse.net Git - casparcg/commitdiff
channel-exp: ffmpeg: Fixed bug with nb_frames, fixed bug with length.
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Sat, 19 Nov 2011 12:47:32 +0000 (12:47 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Sat, 19 Nov 2011 12:47:32 +0000 (12:47 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.2@1591 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

modules/decklink/interop/DeckLinkAPI_h.h
modules/decklink/interop/DeckLinkAPI_i.c
modules/ffmpeg/producer/ffmpeg_producer.cpp
modules/ffmpeg/producer/input/input.cpp
shell/casparcg.config

index 32404b3d643c84fb8a78336e0ee87a27d9d3ac87..471def9ded66f826588515803dd7f571f928b3b0 100644 (file)
@@ -4,7 +4,7 @@
 \r
 \r
  /* File created by MIDL compiler version 7.00.0555 */\r
-/* at Mon Nov 14 10:20:06 2011\r
+/* at Sat Nov 19 12:04:44 2011\r
  */\r
 /* Compiler settings for interop\DeckLinkAPI.idl:\r
     Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 \r
index ad8774620b3503872b2814d2b9c20028d8f57cc6..03f7ab51fb8d21a691e18ef72a298473b6fae441 100644 (file)
@@ -6,7 +6,7 @@
 \r
 \r
  /* File created by MIDL compiler version 7.00.0555 */\r
-/* at Mon Nov 14 10:20:06 2011\r
+/* at Sat Nov 19 12:04:44 2011\r
  */\r
 /* Compiler settings for interop\DeckLinkAPI.idl:\r
     Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 \r
index b4e7c0754c96ee2bd23a89315e7374e8791ca160..d916b1dccbf2fdd287488bde22c4f5c8d7727b0f 100644 (file)
@@ -220,9 +220,11 @@ public:
                        auto video_nb_frames = video_decoder_ ? video_decoder_->nb_frames() : std::numeric_limits<int64_t>::max();\r
                        auto audio_nb_frames = audio_decoder_ ? audio_decoder_->nb_frames() : std::numeric_limits<int64_t>::max();\r
 \r
-                       nb_frames = std::min(static_cast<int64_t>(length_), std::max(nb_frames, std::max(video_nb_frames, audio_nb_frames)));\r
+                       nb_frames = std::max(nb_frames, std::max(video_nb_frames, audio_nb_frames));\r
                }\r
 \r
+               nb_frames = std::min(static_cast<int64_t>(length_), nb_frames);\r
+\r
                nb_frames = muxer_->calc_nb_frames(nb_frames);\r
 \r
                // TODO: Might need to scale nb_frames av frame_muxer transformations.\r
index abd2b0390e6824c5e15164166efca9ba477e6091..233d218824a4e7e99b2f1d781980a84a2e651554 100644 (file)
@@ -97,6 +97,10 @@ public:
                , length_(length)\r
                , frame_number_(0)\r
        {                                       \r
+               buffer_size_    = 0;\r
+               nb_frames_              = 0;\r
+               nb_loops_               = 0;\r
+\r
                if(start_ > 0)                  \r
                        seek_frame(start_);\r
                                                                \r
@@ -106,6 +110,8 @@ public:
                \r
                is_running_ = true;\r
                thread_ = boost::thread([this]{run();});\r
+\r
+               CASPAR_LOG(info) << print() << L" Initialized.";\r
        }\r
 \r
        ~implementation()\r
@@ -151,6 +157,8 @@ private:
                try\r
                {\r
                        CASPAR_LOG(info) << print() << " Thread Started.";\r
+                       \r
+                       CASPAR_ASSERT(nb_frames_ < 1000);\r
 \r
                        while(is_running_)\r
                        {\r
@@ -176,6 +184,8 @@ private:
                auto packet = create_packet();\r
                auto ret        = av_read_frame(format_context_.get(), packet.get()); // packet is only valid until next call of av_read_frame. Use av_dup_packet to extend its life.   \r
                \r
+               CASPAR_ASSERT(nb_frames_ < 1000);\r
+\r
                if(is_eof(ret))                                                                                                              \r
                {\r
                        ++nb_loops_;\r
index 655cefb3aa70554e001c3efc57af3e7e82709724..edf494566864dd65cd8542cf535e9a36048f6a68 100644 (file)
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>\r
 <configuration>\r
   <paths>\r
-    <media-path>C:\Documents and Settings\rona01\Desktop\CasparCG 2.0 Beta 2\server\media\</media-path>\r
-    <log-path>C:\Documents and Settings\rona01\Desktop\CasparCG 2.0 Beta 2\server\log\</log-path>\r
-    <data-path>C:\Documents and Settings\rona01\Desktop\CasparCG 2.0 Beta 2\server\data\</data-path>\r
-    <template-path>C:\Documents and Settings\rona01\Desktop\CasparCG 2.0 Beta 2\server\templates\</template-path>\r
+    <media-path>L:\casparcg\_media\</media-path>\r
+    <log-path>L:\casparcg\_log\</log-path>\r
+    <data-path>L:\casparcg\_data\</data-path>\r
+    <template-path>L:\casparcg\_templates\</template-path>\r
   </paths>\r
   <mixers>\r
     <blend-modes>true</blend-modes>\r
@@ -16,7 +16,7 @@
     <channel>\r
       <video-mode>720p5000</video-mode>\r
       <consumers>\r
-        <screen></screen>\r
+        <decklink></decklink>\r
       </consumers>\r
     </channel>\r
   </channels>\r