\r
void push(const std::shared_ptr<AVFrame>& frame)\r
{ \r
-\r
if(!graph_)\r
{\r
graph_.reset(avfilter_graph_alloc(), [](AVFilterGraph* p){avfilter_graph_free(&p);});\r
{\r
auto filter_name = graph_->filters[n]->name;\r
if(strstr(filter_name, "yadif") != 0)\r
- parallel_yadif_ctx_ = make_parallel_yadif(graph_->filters[n]);\r
+ parallel_yadif_ctx_ = make_parallel_yadif(graph_->filters[n], frame->height);\r
}\r
}\r
\r
parallel_line_func_pool.push(reinterpret_cast<decltype(fs[0])>(func));\r
}\r
\r
-std::shared_ptr<void> make_parallel_yadif(AVFilterContext* ctx)\r
+std::shared_ptr<void> make_parallel_yadif(AVFilterContext* ctx, size_t height)\r
{\r
+ if(height % 64 != 0)\r
+ return std::shared_ptr<void>(nullptr, return_parallel_yadif);\r
+\r
static boost::once_flag flag = BOOST_ONCE_INIT;\r
boost::call_once(&init_pool, flag);\r
\r
YADIFContext* yadif = (YADIFContext*)ctx->priv;\r
org_yadif_filter_line = yadif->filter_line; // Data race is not a problem.\r
-\r
+ \r
decltype(org_yadif_filter_line) func = nullptr;\r
if(!parallel_line_func_pool.try_pop(func)) \r
CASPAR_LOG(warning) << "Not enough scalable-yadif context instances. Running non-scalable";\r