video_frames_.front().first == audio_chunks_.front().first);\r
}\r
\r
+ // FIXME: Don't re-interlace when going from 50i to 50p, maybe do this inside decoder?\r
safe_ptr<core::basic_frame> get_video_frame(std::vector<int16_t>&& audio_chunk)\r
{\r
auto frame = std::move(video_frames_.front().second); \r
size_t filter_delay_;\r
\r
safe_ptr<AVFrame> last_frame_;\r
+ std::string filter_str_;\r
\r
public:\r
explicit implementation(input& input, const safe_ptr<core::frame_factory>& frame_factory, const std::string& filter_str) \r
, filter_(filter_str.empty() ? nullptr : new filter(filter_str))\r
, filter_delay_(0)\r
, last_frame_(avcodec_alloc_frame(), av_free)\r
+ , filter_str_(filter_str)\r
{\r
}\r
\r
for(size_t n = 0; n < filter_delay_; ++n)\r
boost::range::push_back(result, get_frames(last_frame_));\r
\r
+ // FIXME: Unnecessary reinitialization\r
+ filter_.reset(filter_str_.empty() ? nullptr : new filter(filter_str_));\r
+\r
frame_number_ = 0;\r
filter_delay_ = 0;\r
avcodec_flush_buffers(&codec_context_);\r
std::stringstream buffer_ss;\r
buffer_ss << frame->width << ":" << frame->height << ":" << frame->format << ":" << 0 << ":" << 0 << ":" << 0 << ":" << 0; // don't care about pts and aspect_ratio\r
errn = avfilter_graph_create_filter(&video_in_filter_, avfilter_get_by_name("buffer"), "src", buffer_ss.str().c_str(), NULL, graph_.get());\r
- if(errn < 0)\r
+ if(errn < 0 || !video_in_filter_)\r
{\r
BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(av_error_str(errn)) <<\r
boost::errinfo_api_function("avfilter_graph_create_filter") << boost::errinfo_errno(AVUNERROR(errn)));\r
\r
// Output\r
errn = avfilter_graph_create_filter(&video_out_filter_, avfilter_get_by_name("nullsink"), "out", NULL, NULL, graph_.get());\r
- if(errn < 0)\r
+ if(errn < 0 || !video_out_filter_)\r
{\r
BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(av_error_str(errn)) <<\r
boost::errinfo_api_function("avfilter_graph_create_filter") << boost::errinfo_errno(AVUNERROR(errn)));\r
BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(av_error_str(errn)) \r
<< boost::errinfo_api_function("avfilter_graph_config") << boost::errinfo_errno(AVUNERROR(errn)));\r
}\r
+\r
+ CASPAR_LOG(info) << "Successfully initialized filter.";\r
}\r
\r
errn = av_vsrc_buffer_add_frame(video_in_filter_, frame.get(), 0);\r
{ \r
auto link = video_out_filter_->inputs[0];\r
\r
+ CASPAR_ASSERT(link);\r
+\r
int errn = avfilter_request_frame(link); \r
if(errn < 0)\r
{\r