Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06b3ff7d authored by Andreas Huber's avatar Andreas Huber
Browse files

Make the MediaMetadataTest a little more lenient when it comes to verifying...

Make the MediaMetadataTest a little more lenient when it comes to verifying the duration of media files, only require that the returned duration is within 100ms of the expected one, as the PV and stagefright implementations differ slightly.

related-to-bug: 2377534
parent 918007b7
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -250,7 +250,11 @@ public class MediaMetadataTest extends AndroidTestCase {
        
        value = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION);
        Log.v(TAG, "Expected = " + meta_data_file[fileIndex][meta.DURATION.ordinal()] + "reult = " + value);
        assertEquals(TAG, meta_data_file[fileIndex][meta.DURATION.ordinal()], value);
        // Only require that the returned duration is within 100ms of the expected
        // one as PV and stagefright differ slightly in their implementation.
        assertTrue(TAG, Math.abs(Integer.parseInt(
                        meta_data_file[fileIndex][meta.DURATION.ordinal()])
                            - Integer.parseInt(value)) < 100);
        
        //METADATA_KEY_NUM_TRACKS should return the total number of tracks in the media
        //include the video and audio