Have example/gifplayer show partial results

This commit is contained in:
Nigel Tao committed 2019-09-14 08:33:07 +10:00
1 parent 8d408c7c2c
commit 050bca9120
1 file changed
+9 -6
+9 -6
View File
@@ -370,12 +370,10 @@ const char* play() {
} }
} }
status = wuffs_gif__decoder__decode_frame(&dec, &pb, &src, workbuf, NULL); wuffs_base__status decode_frame_status =
if (status) { wuffs_gif__decoder__decode_frame(&dec, &pb, &src, workbuf, NULL);
if (status == wuffs_base__warning__end_of_data) { if (decode_frame_status == wuffs_base__warning__end_of_data) {
break; break;
}
return status;
} }
compose(&pb, wuffs_base__frame_config__bounds(&fc)); compose(&pb, wuffs_base__frame_config__bounds(&fc));
@@ -416,12 +414,17 @@ const char* play() {
#endif #endif
fwrite(printbuf.ptr, sizeof(uint8_t), n, stdout); fwrite(printbuf.ptr, sizeof(uint8_t), n, stdout);
fflush(stdout);
cumulative_delay_micros += cumulative_delay_micros +=
(1000 * wuffs_base__frame_config__duration(&fc)) / (1000 * wuffs_base__frame_config__duration(&fc)) /
WUFFS_BASE__FLICKS_PER_MILLISECOND; WUFFS_BASE__FLICKS_PER_MILLISECOND;
// TODO: should a zero duration mean to show this frame forever? // TODO: should a zero duration mean to show this frame forever?
if (decode_frame_status) {
return decode_frame_status;
}
} }
if (first_play) { if (first_play) {