Skip to content

Commit 7368949

Browse files
ychaparovcopybara-github
authored andcommitted
Fix wrongly reverted test changes
PiperOrigin-RevId: 758123497
1 parent a4c1012 commit 7368949

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

libraries/transformer/src/androidTest/java/androidx/media3/transformer/TransformerEndToEndTest.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,12 @@ public void videoEditing_withOneFrameInEncoder_completesWithConsistentFrameCount
555555
.build()
556556
.run(testId, editedMediaItem);
557557

558+
// Rarely, MediaCodec decoders output frames in the wrong order.
559+
// When the MediaCodec encoder sees frames in the wrong order, fewer output frames are produced.
560+
// Use a tolerance when comparing frame counts. See b/343476417#comment5.
558561
assertThat(result.exportResult.videoFrameCount)
559-
.isEqualTo(MP4_ASSET_WITH_INCREASING_TIMESTAMPS_320W_240H_15S.videoFrameCount);
562+
.isWithin(2)
563+
.of(MP4_ASSET_WITH_INCREASING_TIMESTAMPS_320W_240H_15S.videoFrameCount);
560564
assertThat(new File(result.filePath).length()).isGreaterThan(0);
561565
}
562566

@@ -582,8 +586,12 @@ public void videoEditing_withMaxFramesInEncoder_completesWithConsistentFrameCoun
582586
.build()
583587
.run(testId, editedMediaItem);
584588

589+
// Rarely, MediaCodec decoders output frames in the wrong order.
590+
// When the MediaCodec encoder sees frames in the wrong order, fewer output frames are produced.
591+
// Use a tolerance when comparing frame counts. See b/343476417#comment5.
585592
assertThat(result.exportResult.videoFrameCount)
586-
.isEqualTo(MP4_ASSET_WITH_INCREASING_TIMESTAMPS_320W_240H_15S.videoFrameCount);
593+
.isWithin(2)
594+
.of(MP4_ASSET_WITH_INCREASING_TIMESTAMPS_320W_240H_15S.videoFrameCount);
587595
assertThat(new File(result.filePath).length()).isGreaterThan(0);
588596
}
589597

0 commit comments

Comments
 (0)