Skip to content

Commit

Permalink
fix: fixed first frame flicker. (#1725)
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwebrtc authored Dec 23, 2024
1 parent da87b32 commit 2a130aa
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ public void pauseVideo() {
// VideoSink interface.
@Override
public void onFrame(VideoFrame frame) {
if(!isFirstFrameRendered) {
texture.setDefaultBufferSize(frame.getRotatedWidth(), frame.getRotatedHeight());
createEglSurface(texture);
}
updateFrameDimensionsAndReportEvents(frame);
super.onFrame(frame);
}
Expand All @@ -104,7 +108,6 @@ public void onFrame(VideoFrame frame) {
public void surfaceCreated(final SurfaceTexture texture) {
ThreadUtils.checkIsOnMainThread();
this.texture = texture;
createEglSurface(texture);
}

public void surfaceDestroyed() {
Expand Down

0 comments on commit 2a130aa

Please sign in to comment.