mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-08-18 01:40:26 +03:00
Tests/LibMedia: Ensure that frame timestamps increase monotonically
This commit is contained in:
parent
ef99e701b7
commit
d851945aad
Notes:
sideshowbarker
2024-07-17 11:30:54 +09:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/d851945aad Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/230 Reviewed-by: https://github.com/ADKaster
@ -28,6 +28,8 @@ static inline void decode_video(StringView path, size_t expected_frame_count, T
|
|||||||
size_t frame_count = 0;
|
size_t frame_count = 0;
|
||||||
NonnullOwnPtr<Media::VideoDecoder> decoder = create_decoder(iterator);
|
NonnullOwnPtr<Media::VideoDecoder> decoder = create_decoder(iterator);
|
||||||
|
|
||||||
|
auto last_timestamp = Duration::min();
|
||||||
|
|
||||||
while (frame_count <= expected_frame_count) {
|
while (frame_count <= expected_frame_count) {
|
||||||
auto block_result = iterator.next_block();
|
auto block_result = iterator.next_block();
|
||||||
if (block_result.is_error() && block_result.error().category() == Media::DecoderErrorCategory::EndOfStream) {
|
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;
|
break;
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
EXPECT(last_timestamp <= frame_result.value()->timestamp());
|
||||||
|
last_timestamp = frame_result.value()->timestamp();
|
||||||
}
|
}
|
||||||
frame_count++;
|
frame_count++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user