Closed simnalamburt closed 1 year ago
NOTE: When the animation finishes the loop and comes back to the beginning, then the first frame is played normally, so you probably didn't notice.
I applied the second solution you suggested with e191e6be4e2c861cb1d1431244e67e8e1185b2ac. It will be available in the next release. Thanks for your help.
In other words, flutter_avif plays from the second frame of the image.
flutter_avif calls
avifDecoderNextImage()
to parse each frame of AVIF images from the beginning, butavifDecoderReadMemory()
also parses the very first frame since it internally callsavifDecoderNextImage()
. Therefore, the current implementation results in discarding the very first frame of the animation.To fix this, there is two solution:
avifDecoderNextImage()
and then parsing the frame, parse the frame and then callavifDecoderNextImage()
. (It's like to use a do-while statement instead of a plain while statement)avifDecoderSetIO*()
,avifDecoderParse()
,avifDecoderNextImage()
interface instead ofavifDecoderReadMemory()
all-in-one interface.If you don't understand my explanation, please comment. Thanks!
References