This can be useful when scripts want to read the entire frame
and pass it on somewhere else (say, write it to a file or use some
library function on it).
This still breaks when the 0 digit is narrower than some other
digit, but that's unlikely and the current behavior now matches
the original behavior when all times are < 10h.
Fixesarch1t3cht/Aegisub#111 .
This is what users will want in the majority of cases, and switching
to this makes using this function much easier.
However, this does break backwards compatibility. Luckily to my
knowledge this function is not actually used in any existing published
script (all scripts using get_frame just use getPixelFormatted instead)
so the damage shouldn't be too large. But this is also why I'd rather
rip off the band-aid of breaking backwards compatibility now than later.
When destroying a frame handle, the previous logic would copy the
shared_ptr in the userdata and then free it twice (once explicitly
and once at the end of the function), which is actually UB, even
if if worked fine so far. This commit now ensures that it's the
actual userdata's shared_ptr that's freed in the gc function.
An unfortunate consequence of this is that the grid widths have to
be computed on every change to line timing, which will probably
have an impact on timing performance when autocommit is enabled.
It's probably not a huge impact but it's worth keeping an eye on.
All current renderers and muxers have no issues with longer timestamps.
However, classic VSFilter keeping track of time with a 32-bit int,
leads to a more meaningful limit at 596h, so enforce that instead.
Since the stringification code for SRT and ASS (but not SMPTE) relied on
hours being single digit, replace them with a simple format string.
GUI inputs are still limited to <10h, but at least
pre-existing timestamps no longer get mangled.
The vfr class (understandably) does not like timecode lists with only
one element, so the current default script breaks when opening images.
So to not bloat the default script too much we just ignore
__aegi_timecodes in the provider in these cases.