Dudemanguy / mpv-manga-reader

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

Double paging is sometimes wrong with wide pages #10

Closed dtop129 closed 3 years ago

dtop129 commented 3 years ago

When autostart is enabled, and the second page width is two times the first page width(so it should be left alone), 80% of the time the two pages will be stitched together, with wrong proportions. The issue disappears if I just go to the next page and back to the first, and is totally absent if the wide page is anywhere but the second page.

Dudemanguy commented 3 years ago

Yeah, sometimes it happens for me too. This is a flaw with the way the script gets file dimensions from the images. When changing pages, the script tries to store the file dimensions (since metadata isn't always available and can be unreliable). It's possible to have a race where mpv returns the property of the old page before it finishes changing to the new page. So you have this bug where the script thinks the second page is an acceptable dimension and runs lavfi-complex on it. It's more noticeable if you use continuous mode since that has more points of failure. In general double page should be fine, but it looks like this case can trigger that particular race.

I'll try to redesign how this mechanism currently works. It's far from perfect.