mirror of
https://github.com/samsonjs/media.git
synced 2026-03-25 09:25:53 +00:00
Composition preview: do not report errors on release
PiperOrigin-RevId: 611096895
This commit is contained in:
parent
09ac916119
commit
55bfe4f95c
1 changed files with 4 additions and 1 deletions
|
|
@ -144,6 +144,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
|
|||
|
||||
private final Context context;
|
||||
private final VideoSinkProvider videoSinkProvider;
|
||||
private final boolean ownsVideoSinkProvider;
|
||||
private final EventDispatcher eventDispatcher;
|
||||
private final int maxDroppedFramesToNotify;
|
||||
private final boolean deviceNeedsNoPostProcessWorkaround;
|
||||
|
|
@ -393,9 +394,11 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
|
|||
this.maxDroppedFramesToNotify = maxDroppedFramesToNotify;
|
||||
this.context = context.getApplicationContext();
|
||||
eventDispatcher = new EventDispatcher(eventHandler, eventListener);
|
||||
ownsVideoSinkProvider = videoSinkProvider == null;
|
||||
if (videoSinkProvider == null) {
|
||||
videoSinkProvider = new CompositingVideoSinkProvider.Builder(this.context).build();
|
||||
}
|
||||
|
||||
if (videoSinkProvider.getVideoFrameReleaseControl() == null) {
|
||||
@SuppressWarnings("nullness:assignment")
|
||||
VideoFrameReleaseControl.@Initialized FrameTimingEvaluator thisRef = this;
|
||||
|
|
@ -730,7 +733,7 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer
|
|||
@Override
|
||||
protected void onRelease() {
|
||||
super.onRelease();
|
||||
if (videoSinkProvider.isInitialized()) {
|
||||
if (ownsVideoSinkProvider && videoSinkProvider.isInitialized()) {
|
||||
videoSinkProvider.release();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue