microsoft / microsoft/Windows-classic-samples

Memory leak IMFSourceReader::ReadSample on AudioClip sample

Open
#108 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
5.7k
Forks
3.3k
PR merge metrics
No merged PRs in 30d

Description

Hello,

I experience a memory leak when using the IMFSourceReader::ReadSample method in sync mode. When reading media samples from a mediafile (not a device), after about 54,000,000 bytes the method returns error 0x8007000E "Not enough storage is available to complete this operation.".

This issue can be reproduced with MF example AudioClip, or the article Tutorial: Decoding Audio

If IMFSourceReader::ReadSample is used in async mode to get camera samples all works fine.

It looks like the internal readbuffers are not released.

Notes:

  • After testing the async mode - IMFSourceReaderCallback::OnReadSample - the result is the same.

  • The operating OS is Windows 10, 1903, November 2019 update.

  • When calling IMFSample::RemoveAllBuffers() before releasing the IMFSample interface makes a noticeable difference, but still the method will leak a huge amount of memory.

Thank you for any solution.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the leak with the AudioClip sample and the linked Tutorial: Decoding Audio, starting at IMFSourceReader::ReadSample in synchronous mode. Compare this with IMFSourceReaderCallback::OnReadSample and test whether IMFSample::RemoveAllBuffers() changes the result; done means identifying and documenting the cause of the memory growth or a verified fix.

Written by the indexing model from the issue text.

Assessment

Domain
audio-video-rtc, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.