timer.tick(0.0);
const auto& format_desc = frame_factory_->get_video_format_desc();
- bool has_frames = lock(frames_mutex_, [&]
+ auto num_frames = lock(frames_mutex_, [&]
{
- return frames_.size() >= format_desc.field_count;
+ return frames_.size();
});
- if (has_frames)
+ if (num_frames >= format_desc.field_count)
{
if (format_desc.field_mode != core::field_mode::progressive)
{
});
}
}
+ else if (num_frames == 1) // Interlaced but only one frame
+ { // available. Probably the last frame
+ // of some animation sequence.
+ auto frame = pop();
+
+ lock(last_frame_mutex_, [&]
+ {
+ last_progressive_frame_ = frame;
+ last_frame_ = frame;
+ });
+
+ timer.tick(1.0 / (format_desc.fps * format_desc.field_count));
+ invoke_requested_animation_frames();
+ }
else
{
graph_->set_tag("late-frame");
}
else if (boost::regex_match(param, what, invoke_exp))
{
- javascript = (boost::wformat(L"%1%()") % boost::algorithm::trim_copy_if(what["VALUE"].str(), boost::is_any_of(" \""))).str();
+ auto function_call = boost::algorithm::trim_copy_if(what["VALUE"].str(), boost::is_any_of(" \""));
+
+ // Append empty () if no parameter list has been given
+ javascript = boost::ends_with(function_call, ")") ? function_call : function_call + L"()";
}
client_->execute_javascript(javascript);