Skip to content

Commit

Permalink
Minimal fix for incorrect no-op condition
Browse files Browse the repository at this point in the history
If you set the output using MSG_SET_OUTPUT_BUFFER_RENDERER and
then clear the output using MSG_SET_SURFACE, or vice-versa, the
second message should not be turned into a no-op.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=139452462
  • Loading branch information
ojw28 committed Nov 18, 2016
1 parent e9ac27f commit 3537ad3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ public void handleMessage(int messageType, Object message) throws ExoPlaybackExc
}

private void setSurface(Surface surface) {
if (this.surface == surface) {
if (this.surface == surface && outputBufferRenderer == null) {
return;
}
this.surface = surface;
Expand All @@ -459,7 +459,7 @@ private void setSurface(Surface surface) {
}

private void setOutputBufferRenderer(VpxOutputBufferRenderer outputBufferRenderer) {
if (this.outputBufferRenderer == outputBufferRenderer) {
if (this.outputBufferRenderer == outputBufferRenderer && surface == null) {
return;
}
this.outputBufferRenderer = outputBufferRenderer;
Expand Down

0 comments on commit 3537ad3

Please sign in to comment.