Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Retain buffer
  • Loading branch information
cbenhagen committed Sep 2, 2021
commit a72e8456633b88cdbd7523a5f696792673a4c37a
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ - (void)notifyIfFrameAvailable {
if (!_playerItem || _playerItem.status != AVPlayerItemStatusReadyToPlay || ![_videoOutput hasNewPixelBufferForItemTime:outputItemTime]) {
return;
} else {
CVBufferRelease(_frame);
_frame = [_videoOutput copyPixelBufferForItemTime:outputItemTime itemTimeForDisplay:NULL];
if (_frame == NULL) {
NSLog(@"copyPixelBufferForItemTime returned NULL");
Expand Down Expand Up @@ -440,6 +441,7 @@ - (CVPixelBufferRef)copyPixelBuffer {
if (_frame == NULL) {
NSLog(@"Returning NULL from copyPixelBuffer");
}
CVBufferRetain(_frame);
return _frame;
}

Expand Down Expand Up @@ -471,6 +473,7 @@ - (FlutterError* _Nullable)onListenWithArguments:(id _Nullable)arguments
/// so the channel is going to die or is already dead.
- (void)disposeSansEventChannel {
_disposed = true;
CVBufferRelease(_frame);
[self stopDisplayLink];
[[_player currentItem] removeObserver:self forKeyPath:@"status" context:statusContext];
[[_player currentItem] removeObserver:self
Expand Down