File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
libraries/transformer/src/androidTest/java/androidx/media3/transformer Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -555,8 +555,12 @@ public void videoEditing_withOneFrameInEncoder_completesWithConsistentFrameCount
555
555
.build ()
556
556
.run (testId , editedMediaItem );
557
557
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.
558
561
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 );
560
564
assertThat (new File (result .filePath ).length ()).isGreaterThan (0 );
561
565
}
562
566
@@ -582,8 +586,12 @@ public void videoEditing_withMaxFramesInEncoder_completesWithConsistentFrameCoun
582
586
.build ()
583
587
.run (testId , editedMediaItem );
584
588
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.
585
592
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 );
587
595
assertThat (new File (result .filePath ).length ()).isGreaterThan (0 );
588
596
}
589
597
You can’t perform that action at this time.
0 commit comments