Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Fixes

- Release `MediaMuxer` when a replay segment has no encodable frames to avoid a resource leak ([#5583](https://github.com/getsentry/sentry-java/pull/5583))

## 8.44.1

### Fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ public class ReplayCache(private val options: SentryOptions, private val replayI

if (frameCount == 0) {
options.logger.log(DEBUG, "Generated a video with no frames, not capturing a replay segment")
encoderLock.acquire().use {
encoder?.release()
encoder = null
}
deleteFile(videoFile)
return null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@
muxer.writeSampleData(videoTrackIndex, encodedData, bufferInfo)
}
Comment thread
runningcode marked this conversation as resolved.

override fun release() {

Check warning on line 69 in sentry-android-replay/src/main/java/io/sentry/android/replay/video/SimpleMp4FrameMuxer.kt

View check run for this annotation

@sentry/warden / warden: check-code-attribution

⚠️ Missing THIRD_PARTY_NOTICES.md entry for vendored file

**io.sentry.android.replay.video.SimpleMp4FrameMuxer** — This file is vendored from `fzyzcjy/flutter_screen_recorder` (MIT) and has a complete attribution header, but there is no corresponding entry in `THIRD_PARTY_NOTICES.md`. Add an entry with Source URL (`https://github.com/fzyzcjy/flutter_screen_recorder/...`), License name (MIT), Copyright (`Copyright (c) 2021 fzyzcjy`), Scope (`sentry-android-replay/src/main/java/io/sentry/android/replay/video/SimpleMp4FrameMuxer.kt`), and the full MIT license text.
muxer.stop()
// stop() throws if the muxer was never started (e.g. no frame was ever muxed), so we guard it
// to ensure release() is always reached and the underlying resources are freed
if (started) {
muxer.stop()
}
muxer.release()
}

Expand Down
Loading