| 431 | } |
| 432 | |
| 433 | void CPullPin::Process(void) |
| 434 | { |
| 435 | // is there anything to do? |
| 436 | if (m_tStop <= m_tStart) |
| 437 | { |
| 438 | EndOfStream(); |
| 439 | return; |
| 440 | } |
| 441 | |
| 442 | BOOL bDiscontinuity = TRUE; |
| 443 | |
| 444 | // if there is more than one sample at the allocator, |
| 445 | // then try to queue 2 at once in order to overlap. |
| 446 | // -- get buffer count and required alignment |
| 447 | ALLOCATOR_PROPERTIES Actual; |
| 448 | HRESULT hr = m_pAlloc->GetProperties(&Actual); |
| 449 | |
| 450 | // align the start position downwards |
| 451 | REFERENCE_TIME tStart = AlignDown(m_tStart / UNITS, Actual.cbAlign) * UNITS; |
| 452 | REFERENCE_TIME tCurrent = tStart; |
| 453 | |
| 454 | REFERENCE_TIME tStop = m_tStop; |
| 455 | if (tStop > m_tDuration) |
| 456 | { |
| 457 | tStop = m_tDuration; |
| 458 | } |
| 459 | |
| 460 | // align the stop position - may be past stop, but that |
| 461 | // doesn't matter |
| 462 | REFERENCE_TIME tAlignStop = AlignUp(tStop / UNITS, Actual.cbAlign) * UNITS; |
| 463 | |
| 464 | DWORD dwRequest; |
| 465 | |
| 466 | if (!m_bSync) |
| 467 | { |
| 468 | |
| 469 | // Break out of the loop either if we get to the end or we're asked |
| 470 | // to do something else |
| 471 | while (tCurrent < tAlignStop) |
| 472 | { |
| 473 | |
| 474 | // Break out without calling EndOfStream if we're asked to |
| 475 | // do something different |
| 476 | if (CheckRequest(&dwRequest)) |
| 477 | { |
| 478 | return; |
| 479 | } |
| 480 | |
| 481 | // queue a first sample |
| 482 | if (Actual.cBuffers > 1) |
| 483 | { |
| 484 | |
| 485 | hr = QueueSample(tCurrent, tAlignStop, TRUE); |
| 486 | bDiscontinuity = FALSE; |
| 487 | |
| 488 | if (FAILED(hr)) |
| 489 | { |
| 490 | return; |
nothing calls this directly
no test coverage detected