mirror of
https://github.com/SerenityOS/serenity
synced 2026-04-25 17:15:42 +02:00
Tests/LibMedia: Ensure that frame timestamps increase monotonically
(cherry picked from commit d851945aad27ccfdee47a3f2b1bc7c9f4fa93a52)
This commit is contained in:
@@ -28,6 +28,8 @@ static inline void decode_video(StringView path, size_t expected_frame_count, T
|
||||
size_t frame_count = 0;
|
||||
NonnullOwnPtr<Media::VideoDecoder> decoder = create_decoder(iterator);
|
||||
|
||||
auto last_timestamp = Duration::min();
|
||||
|
||||
while (frame_count <= expected_frame_count) {
|
||||
auto block_result = iterator.next_block();
|
||||
if (block_result.is_error() && block_result.error().category() == Media::DecoderErrorCategory::EndOfStream) {
|
||||
@@ -45,6 +47,8 @@ static inline void decode_video(StringView path, size_t expected_frame_count, T
|
||||
break;
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
EXPECT(last_timestamp <= frame_result.value()->timestamp());
|
||||
last_timestamp = frame_result.value()->timestamp();
|
||||
}
|
||||
frame_count++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user