Argon- / mpv-stats

Display file statistics in mpv.
GNU Lesser General Public License v2.1
205 stars 19 forks source link

File: line #7

Closed bitingsock closed 9 years ago

bitingsock commented 9 years ago

It appears to be inserting a carriage return to prevent the line from going beyond half the window length. I'm trying to learn; do you know where this behavior is located in the code?

Argon- commented 9 years ago

Huh? No such thing happens ("prevent the line from going beyond half the window length"). Every appended property prints a new line right before it's actual text (https://github.com/Argon-/mpv-stats/blob/master/stats.lua#L200). Or am I misunderstanding your question?

bitingsock commented 9 years ago

screenshot 01 - ready for war ready for what wv00_00_01 060 As you can see, the first line doesn't write as far as the others.

Argon- commented 9 years ago

Interesting but this is most certainly not done by the script, it's not inserting new lines anywhere except before properties and after sections (File/Video/Audio). Could it be the file name contains strange (invisible) characters?

bitingsock commented 9 years ago

No, it's done this with every file I've tried that's long enough. The exception seems to be if there are no spaces it will not break. _ - or other fillers let it work as intended.

bitingsock commented 9 years ago

Ya...definitely the spaces. Still weird that it breaks at that spot.

Argon- commented 9 years ago

Could you send me a little sample or something where it happens for you? screen shot 2015-07-31 at 00 12 29

bitingsock commented 9 years ago

screenshot just a bunch of silence for testing mp300_00_00 639 https://anonfiles.com/file/5343c168a5b86a67b2f2ba1481f4ca75

Argon- commented 9 years ago

Well, this did not preserve your file name and I can't reproduce this problem. Mind sharing your stats config, this does certainly not look like default. And you don't happen to use \q0 somewhere, do you?

bitingsock commented 9 years ago

i edited the lua directly, no config. try setting the font_size to like 30 https://filetea.me/t1szuUpmpBySAeEe0GAtsnusA

Argon- commented 9 years ago

screen shot 2015-07-31 at 01 27 32 There is indeed a bit of margin to the right, as you can see in my screenshot. There would've been enough space to leave the line untouched. However, this isn't (shouldn't be?) related to line breaks inserted by the script but rather to ASS line wrapping. When you disable wrapping (add {\\q2} to the header): screen shot 2015-07-31 at 01 30 33 But of course this would break lines which are really too long so you probably shouldn't do it. Your version looks a bit like you would've used \q0:

Smart wrapping, make each line approximately equally long

http://docs.aegisub.org/3.2/ASS_Tags/#\q

bitingsock commented 9 years ago

https://filetea.me/t1siQYg5W9WRXGgyWBaLwVpRA my version i didn't use \q0 also i tried with yours and added font_size=30 to stats.conf screenshot just a bunch of silence for testing mp300_00_00 810 still problem

Argon- commented 9 years ago

Well, as I said, this is wrapping done by the ASS renderer. You can turn it off or slightly tweak it (q0, q1, q3) but otherwise you have to live with it. Wrapping is not done by the script, nothing I can fix/"turn off". As for why the ASS renderer's wrapping is done so early in the first line... I don't know. Asked in #mpv-devel but nobody else had a good idea either (yet).

bitingsock commented 9 years ago

well thanks for looking into it

bitingsock commented 9 years ago

do you know if the renderer's option is exposed in mpv? or would i have to compile it so? edit: i guess you said you can't so...dang

Argon- commented 9 years ago

I take that back, this actually is fixable (https://github.com/Argon-/mpv-stats/commit/76ae38a2d5bea6ee64b1c91f2bfc2ac484f6f53e). There were a lot of spaces before "File" and I knew that. Since they were not displayed I assumed they don't have any other side effects, however it seems like these (not visible) spaces are taken into account for wrapping calculations by libass (so it assumed there were more characters on screen than we actually saw, therefore breaking the line earlier). The above commit fixed this (by removing the spaces). Imo this is a bug in libass.

Thanks for reporting! I might have never caught that one.

bitingsock commented 9 years ago

neat