locked
IFMediaEngine Video Playback - Occasional Empty Green Screen with Sound and no Other Errors

    Question

  • I've made a custom media player for my Windows store app using SwapChainPanel and IMFMediaEngine. (Basically it's a hybrid of the media engine and swap chain panel examples).

    Most of the time everything is fine. But occasionally, the video output will be nothing but a blank green screen, while everything else is fine. No HRESULT failures. All the correct media engine events get fired. Audio even plays. But nonetheless, the screen is just pure green. 

    My first thought is that the media engine is having trouble reading the file for some reason, and sending all zero bytes as samples, since YUV(0,0,0) is indeed green. But to give no error at all seems very odd. And it still plays sound, so why would it have a problem with the video stream (sometimes) and not the audio stream (ever)?

    Any other ideas what this could be? 

    Many thanks in advance for any thoughts or even speculations.

    Peter

    Tuesday, December 23, 2014 11:46 PM

Answers

  • Is that a joke?

    Anyway, I think I traced the problem to a memory leak. It hasn't resurfaced since I plugged the leak. But still, I'm baffled by the lack of any error message. Silent failures are dangerous...

    Also FWIW, the aforementioned memory leak is in the media engine example, at least the way I was using it. The callback class retains a handle to the media player which never gets released in the ordinary course. When I was opening and closing multiple media players in my app, none were getting released. Adding a means to "divorce" the callback handler from the actual player fixed the issue.

    • Marked as answer by pnm655 Thursday, December 25, 2014 1:38 PM
    Thursday, December 25, 2014 1:38 PM

All replies

  • Is that a joke?

    Anyway, I think I traced the problem to a memory leak. It hasn't resurfaced since I plugged the leak. But still, I'm baffled by the lack of any error message. Silent failures are dangerous...

    Also FWIW, the aforementioned memory leak is in the media engine example, at least the way I was using it. The callback class retains a handle to the media player which never gets released in the ordinary course. When I was opening and closing multiple media players in my app, none were getting released. Adding a means to "divorce" the callback handler from the actual player fixed the issue.

    • Marked as answer by pnm655 Thursday, December 25, 2014 1:38 PM
    Thursday, December 25, 2014 1:38 PM