sub: avoid unneeded calls to is_animated
4e5d996c3a3f74a7308aee53614c2b94c71daebc added this as part of a series of patches written to avoid wasteful sub redraws when playing a still image with subs. The is_animated special case was specifically for ASS subtitles that have animations/effects and would need repeated redraws in the still image case. This check was done unconditionally for all ASS subtitles, but for very big ASS subtitles, this text parsing can get a bit expensive. Because this function call is only ever needed for the weird edge case of ASS subtitles over a still image, some additional logic can be added to avoid calling is_animated in the vast majority of cases. The animated field in demux_packet can be changed to a tristate instead where -1 indicates "unknown" (the default state). In update_subtitle, we can look at the current state of the video tracks and decide whether or not it is neccesary to perform is_animated and pass that knowledge to sd_ass before any subtitle packets are decoded and thus save us from doing this potentially expensive call.
D
Dudemanguy committed
fa89082f2ea8919997d99a040e23d4d4e346bb60
Parent: 7e82108