Memory leak in Advanced Profile Decoder DMO

Discussion in 'Windows Media Player' started by Frans van Dorsselaer, May 17, 2006.

  1. The Advanced Profile Decoder DMO (wmvadvd.dll) leaks
    approx. 2kB per stream decoded. The problem is reproducable,
    and occurs with every WMVA encoded file I have tried.
    If the DMO is released before decoding the first frame
    (ProcessOutput returning S_OK) the leak does not occur.
    But as soon as at least 1 frame is properly decoded, the
    leak is 2kB irrespective of what else is done with the DMO.

    I can provide sample video files and/or player source
    code that demonstrates the problem.

    2kB isn't much, unless you have written a TV generator
    displaying a collage of 1000+ short clips 24/7. Currently
    I am leaking 40MB per day :(
     
    Frans van Dorsselaer, May 17, 2006
    #1
    1. Advertisements

  2. Frans van Dorsselaer

    zachd [MSFT] Guest

    I'll mention this to my encoding guru friend. Do you run into this in WMP,
    or just your custom code?

    Geeeeeenerally you'll find that either the windowsmedia.sdk newsgroup or the
    doom9 forums will get much more encoder experienced eyes looking at your
    posts. =)
     
    zachd [MSFT], May 17, 2006
    #2
    1. Advertisements

  3. Thanks for your reply. I will post the same into the SDK group.
    I found the problem using my own custom code. But I am convinced
    the leak is in the DMO (not ASF reader or anything else), so I am
    also sure it will show in WMP. 2kB however is a very small amount,
    but maybe with a 1000+ entries playlist one could spot it
    in WMP as well.

    Here is some more info:
    The leak can be repeated *in the same DMO instance* if
    you use SetInputType() again after decoding at least 1 frame.
    So appearantly decoding the first frame successfully allocates
    the memory, the pointer to which is reset at SetInputType()
    without freeing it. Then when decoding another first frame another
    leak occurs.
    Calling Flush(), Discontinue(), or FreeStreamingResources()
    does not help. The memory is lost forever and I found no way
    to make the DMO release it properly.

    The pseudo code to leak a large amount quickly would therefore be:

    Instantiate DMO
    loop (
    SetInputType
    SetOutputType
    ProcessInput
    ProcessOutput
    )
    Release DMO

    At this point 2kB times the number of loops has
    gone from the heap.
    Leak occurs only if ProcessOutput succeeds at least once.
     
    Frans van Dorsselaer, May 18, 2006
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.