// Wait until all frames are accounted for, and free them.
{
unique_lock<mutex> lock(frame_queue_mutex);
// Wait until all frames are accounted for, and free them.
{
unique_lock<mutex> lock(frame_queue_mutex);
BMDTimeValue pts = frame->pts;
BMDTimeValue duration = frame->duration;
HRESULT res = output->ScheduleVideoFrame(frame.get(), pts, duration, TIMEBASE);
BMDTimeValue pts = frame->pts;
BMDTimeValue duration = frame->duration;
HRESULT res = output->ScheduleVideoFrame(frame.get(), pts, duration, TIMEBASE);