[mythtv] Rendering of subtitles and output flushing?
Kingsley Turner
krt at krt.com.au
Sat Jan 9 08:17:26 UTC 2016
G'day,
There's this bug I'm working on ...
The use-case is a foreign-audio movie with a couple standing in front of a
street sign.
Before they say anything the subtitle to translate the sign is shown above
the character's heads.
Then as they talk, the dialogue subtitles change underneath.
The sign subtitle should remain static (according to the subs), and only the
dialogue changes.
However in MythTV, each time the dialogue subtitle changes, the subtitle for
the sign flashes on & off.
It's really distracting, and if the static text is anything non-trivial,
quite hard to read.
What's confusing me the most is that the bit that flashes is rendered
on-screen delayed by 100-200ms (estimated) with respect to the other subs.
(This is on my reasonably powerful workstation too).
So I checked that the Sub Station Alpha / "libass" subtitles are decoding
correctly - they are.
Each time the static part arrives along with the new dialogue part.
0,0:00:10.11, 0:00:15.03, sign_style, sign, 0,0,0,,[Subway]
0,0:00:10.52, 0:00:12.61, main_text, bob, 0,0,0,,Hey! Long time no see!
0,0:00:12.91, 0:00:15.03, main_text, mary, 0,0,0,,How-ya-goin'
(etc.)
I guessed that perhaps because subtitle images come in a letter-by-letter
list of images, that this could be the source of the time delta, and thus
the reason for the flashing. I modified SubtitleScreen::RenderAssTrack() to
pre-render all the subtitle parts to a single image, and then passed that
back to UI for drawing on-screen.
Ah-ha! I thought. There's only a single image for all the components of the
subtitle. They can't possibly be rendered at different times.
But they are! And that flippin' sign is still flashing, and it's also being
rendered before (or after, I don't remember) the dialogue subtitles.
The only thing I can think of here is that the subtitle is being rendered up
the screen as we watch, rather than being double-buffered to the display.
Does this sound plausible?
I'm scratching my head a bit where to look next.
cheers,
-Kingsley
More information about the mythtv-dev
mailing list