\r
#include <common/env.h>\r
#include <common/utility/timer.h>\r
+#include <common/utility/assert.h>\r
\r
#include <tbb/parallel_invoke.h>\r
\r
double frame_time = 1.0f/input_->fps();\r
double format_frame_time = 1.0/frame_factory->get_video_format_desc().fps;\r
if(abs(frame_time - format_frame_time) > 0.0001)\r
- CASPAR_LOG(warning) << print() << L" Invalid framerate detected. This may cause distorted audio during playback.";\r
+ CASPAR_LOG(warning) << print() << L" Invalid framerate detected. This may cause distorted audio during playback. frame-time: " << frame_time;\r
\r
}\r
\r
{\r
perf_timer_.reset();\r
\r
- while(ouput_channel_.empty() && !input_->is_eof())\r
+ while(ouput_channel_.size() < 2 && !input_->is_eof())\r
{ \r
aligned_buffer video_packet;\r
if(video_frame_channel_.size() < 3 && video_decoder_) \r
auto result = last_frame_;\r
if(!ouput_channel_.empty())\r
{\r
- result = std::move(ouput_channel_.front());\r
- last_frame_ = core::basic_frame(result);\r
- last_frame_->get_audio_transform().set_gain(0.0); // last_frame should not have audio\r
- ouput_channel_.pop();\r
+ result = get_frame();\r
+\r
+ bool interlace = abs(input_->fps()/2.0 - frame_factory_->get_video_format_desc().fps) < 0.001;\r
+ if(interlace && !ouput_channel_.empty())\r
+ result = core::basic_frame::interlace(result, get_frame(), frame_factory_->get_video_format_desc().mode);\r
}\r
else if(input_->is_eof())\r
- return core::basic_frame::eof();\r
+ result = core::basic_frame::eof();\r
+ \r
+ return result;\r
+ }\r
\r
+ core::basic_frame get_frame()\r
+ {\r
+ CASPAR_ASSERT(!ouput_channel_.empty());\r
+ auto result = std::move(ouput_channel_.front());\r
+ last_frame_ = core::basic_frame(result);\r
+ last_frame_->get_audio_transform().set_gain(0.0); // last_frame should not have audio\r
+ ouput_channel_.pop();\r
return result;\r
}\r
\r
<channel>\r
<videomode>PAL</videomode>\r
<consumers>\r
- <!--ogl>\r
+ <ogl>\r
<device>0</device>\r
<stretch>uniform</stretch>\r
<windowed>true</windowed>\r
- </ogl-->\r
+ </ogl>\r
<audio/>\r
<!--decklink>\r
<device>1</device>\r
<embedded-audio>true</embedded-audio>\r
<internal-key>false</internal-key>\r
</decklink-->\r
- <bluefish>\r
+ <!--<bluefish>\r
<device>1</device>\r
<embedded-audio>false</embedded-audio>\r
- </bluefish>\r
+ </bluefish>-->\r
</consumers>\r
</channel>\r
</channels>\r