SocksTheWolf / obs-image-reaction

An OBS Plugin that animates an image using sound.
GNU General Public License v2.0
1 stars 0 forks source link

Looped gifs cause frame decoding/load during GPU fence #1

Open SocksTheWolf opened 10 months ago

SocksTheWolf commented 10 months ago

Gifs that loop do not properly tick correctly, and should be using the internal functionality of the obs image loading system. The code currently handles non-looping gifs correctly, however:

In the OBS image handling file (https://github.com/obsproject/obs-studio/blob/master/libobs/graphics/image-file.c), if gif.cur_loop is set to infinity (0xFFFF, when the gif file is loaded), then the loop will be handled internally automatically, otherwise loop_count is used in the main image structure.

Regardless, we should be not handling tick ourselves and instead using the OBS functionality.

The problematic lines occur in the following blocks:

https://github.com/SocksTheWolf/obs-image-reaction/blob/bd5deec78f9a393abe3b15ee3271d0a55d7f3365/src/image-reaction.c#L366

https://github.com/SocksTheWolf/obs-image-reaction/blob/bd5deec78f9a393abe3b15ee3271d0a55d7f3365/src/image-reaction.c#L392

Both of these should properly be ticking (via gs_image_file3_tick) rather than trying to update the gif the entire time.

SocksTheWolf commented 10 months ago

https://docs.obsproject.com/reference-libobs-graphics-image-file#c.gs_image_file_update_texture