decoder: Fix animations with variable frame length

Before, the length of the first frame was used for all frames.

Part-of: <https://gitlab.gnome.org/GNOME/loupe/-/merge_requests/300>
This commit is contained in:
Sophie Herold 2023-09-27 00:47:24 +02:00 • committed by Marge Bot
parent 19bf8473e6
commit 65e7789863
2 changed files with 2 additions and 2 deletions

View file

@ -106,7 +106,7 @@ impl Glycin {
texture: frame.texture, texture: frame.texture,
}; };
tiles.push_frame(tile, dimensions, delay); tiles.push_frame(tile, dimensions, frame.delay.unwrap_or(delay));
if tiles.n_frames() >= FRAME_BUFFER { if tiles.n_frames() >= FRAME_BUFFER {
break; break;

View file

@ -661,7 +661,7 @@ impl FrameBufferExt for ArcSwap<FrameBuffer> {
if self if self
.load() .load()
.images .images
.get(1) .front()
.is_some_and(|next_frame| elapsed >= next_frame.delay) .is_some_and(|next_frame| elapsed >= next_frame.delay)
{ {
self.rcu(|tiling_store| { self.rcu(|tiling_store| {