openframeworks / openframeworks/openFrameworks

ofAVFoundationVideoPlayer memory leak

Open
#4,401 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

close
Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

Just noticed a large memory leak in ofAVFoundationVideoPlayer's -(void) updateFromVideoOutput method. The CVPixelBufferRef buffer does not get released. If you load any HD movie and constantly adjust the playhead (setPosition() or setFrame()) - it will eat through all your memory very quick (8gb of memory in less than 2 min for me).

Fix: https://github.com/trentbrooks/openFrameworks/commit/7312aff0f7667df379c4b3bd91857d51e9ec25d0

Contributor guide

Open the contributing guide

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

Start by locating ofAVFoundationVideoPlayer's updateFromVideoOutput method and reviewing the referenced commit 7312aff0f7667df379c4b3bd91857d51e9ec25d0. Reproduce the issue with an HD movie while repeatedly adjusting the playhead via setPosition() or setFrame(). Done means the CVPixelBufferRef is released and memory no longer grows rapidly during that stress case.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
audio-video-rtc
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.