Quantcast
Channel: Media Foundation Development for Windows Desktop forum
Viewing all articles
Browse latest Browse all 1079

IMFMediaSession::Start method stops working on second intance

$
0
0

I have created a test app modeled on the playlist example in the vista sdk. I modified it a bit to play video and loop with the skip function. I then set it up to create two windows with a player in each. Now with one window it plays just fine and loops as expected. When I add a second window with another playlist something strange begins to happen. The first window plays and loops just fine, but when it comes to the second window, when it gets to the end of the sequencer source, it triggers the MEEndOfPresentation event. The code is set to call the skip function, which it executes fine. Then the player just goes black. It must still be playing or something, because if I wait the player will start playing again. If I wait even longer it will go black again. Now the whole time the first window is running fine.

I have built this test app with the following example

https://msdn.microsoft.com/en-us/library/ms697285(v=vs.85).aspx

I could post the code for the test app, but it is quite a bit. I am hoping someone might have a clue to what the problem is before I fill this thread with code. I would appreciate it if someone could help me work through this problem.

HRESULT

CPlayer::Skip (constMFSequencerElementIdSegmentID)

{

   

TRACE((L"\nCPlayer::Skip"));

   

HRESULThr =S_OK;

   

PROPVARIANTvar;

    PropVariantInit (&var);

  

//this->m_pMediaSession->Stop();


    hr = MFCreateSequencerSegmentOffset(

 SegmentID,NULL, &var);

   

   

if(SUCCEEDED(hr))

    {

        hr = m_pMediaSession->Start(&MF_TIME_FORMAT_SEGMENT_OFFSET, &var);  // this call seems to stop working.

       

LOG_IF_FAILED(L"IMFMediaSession::Start from skip", hr);

    }

    PropVariantClear(&var);

   

returnhr;

}

Thank You



Viewing all articles
Browse latest Browse all 1079

Trending Articles