locked
IMFAsyncResult::GetStatus() returns MF_E_TIMER_ORPHANED RRS feed

  • Question

  • In what circumstances is MF_E_TIMER_ORPHANED set, as I could not find any documentation on it?

    The callback gets invoked twice as soon as the presentation starts, instead of at the desired times of 50,000,000 and 70,000,000 MFTIMEs.

    Media sink is the SAR, media source is an audio file.

    ...

    case MESessionTopologyStatus:
        pEvent->GetUINT32(MF_EVENT_TOPOLOGY_STATUS, &iTopoStatus);

        if (iTopoStatus == MF_TOPOSTATUS_READY)
        {
            ...

            hr = mpSession->GetClock((IMFClock**)&mpPresentationClock);

            hr = mpPresentationClock->QueryInterface(IID_PPV_ARGS(&mpTimer));

            SetLoopsOnTimer();

            ...

        }

    STDMETHODIMP MyClass::SetLoopsOnTimer()

    {

            ....

            clockTime = _Loops[i]->StartTicks;
            hr = mpTimer->SetTimer(0, clockTime, _Loops[i]->cb, static_cast<IUnknown*>(_Loops[i]->startMarker), NULL);
            clockTime = _Loops[i]->StartTicks + _Loops[i]->DurationTicks;
            hr = mpTimer->SetTimer(0, clockTime, _Loops[i]->cb, static_cast<IUnknown*>(_Loops[i]->endMarker), NULL);

            ...

    }

    Thursday, May 4, 2017 10:06 AM

Answers

  • The solution was to call SetLoopsOnTimer() in the MESessionStarted event, not MESessionTopologyStatus.
    • Marked as answer by John_78f Thursday, May 4, 2017 1:26 PM
    Thursday, May 4, 2017 1:26 PM