Dudemanguy / mpv-manga-reader

Manga reading script for mpv
GNU General Public License v3.0
119 stars 4 forks source link

Continuous mode briefly flashes out of order page #12

Open krispykiq opened 2 years ago

krispykiq commented 2 years ago

After you reach the end of the rendered pages it flashes an image and immediately goes to normal. It makes it confusing because the image it flashes is out of order.

For example in a file with 20 images, when you reach the end of the page 8, it flashes page 16 then shows page 9. When you reach page 16, it flashes page 20 then goes to normal.

Dudemanguy commented 2 years ago

Yeah that's because of how the logic works with observing the pan value and flipping pages. I'll probably refactor this to be better.

Dudemanguy commented 2 years ago

I can add some workarounds to make it a little better, but I think you will always have a slight flash because of how this works in mpv. Basically, switching files is an async operation not a blocking one so the pan change happens while it is changing pages. Related mpv issue. https://github.com/mpv-player/mpv/issues/7293

krispykiq commented 2 years ago

Why not add the workaround to make it better then show a black rectangle to cover the flicker?

Dudemanguy commented 2 years ago

The said workarounds I was thinking of was basically just making the image temporarily black while switching pages. The flicker appears to always be visible though. Just less visible.

Dudemanguy commented 2 years ago

Apologies for the delay. I got around to trying to see if I could make this any better (basically turning down brightness/contrast all the way down before changing page), but sadly I do not think there is a real benefit. What will happen is that the page does indeed turn black, but changing pages flickers no matter what. I think this is just how mpv internally works. Unsetting brightness/contrast settings always seems to happen at the same time the vertical alignment is changed (the source of the flicker you are seeing). It doesn't matter if I do something stupid like sleep after changing a page; mpv always works this way. So sadly this isn't fixable at this level.