Opened 10 years ago

Closed 10 years ago

#10111 closed Bug Report - General (Fixed)

EIA-608 caption timing broken

Reported by: Jim Stichnoth <stichnot@…> Owned by: danielk
Priority: minor Milestone: 0.25
Component: MythTV - General Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no


Some recent changes to trunk have broken the display of EIA-608 closed captions. It looks like the caption display is being delayed until it is time to be erased, so each caption just flashes for a split second.

In addition, video frames are being dropped when the caption is displayed, see the attached log.

In case it helps narrow things down, I didn't see either problem with version v0.25pre-3204-g488fff8-dirty; I saw the video frame dropping problem when I moved from [488fff8] to v0.25pre-3471-g17138af-dirty; and the split-second caption display problem showed up when I moved from [17138af] to v0.25pre-3542-gaa44cb6-dirty.

Attachments (2)

mythfrontend.log (60.8 KB) - added by Jim Stichnoth <stichnot@…> 10 years ago.
mythfrontend.version.txt (774 bytes) - added by Jim Stichnoth <stichnot@…> 10 years ago.

Download all attachments as: .zip

Change History (10)

Changed 10 years ago by Jim Stichnoth <stichnot@…>

Attachment: mythfrontend.log added

Changed 10 years ago by Jim Stichnoth <stichnot@…>

Attachment: mythfrontend.version.txt added

comment:1 Changed 10 years ago by markk

Milestone: unknown0.25
Owner: set to danielk
Status: newassigned

I've confirmed this locally. I'm pretty certain the frame dropping is a side effect of the timing issue - the captions are being reset rapidly and the cpu can't keep up.

Looking at the log for cc608decoder.cpp, the prime culprit would appear to be d526385aa4c1466b064e9544cdb663f357007e35.

If I revert just the cc608decoder.cpp elements of that commit, then the worst of the flashing is fixed (though the timing still doesn't seem quite right).

608 captions are black magic as far as I'm concerned:) - so assigning to danielk.

comment:2 Changed 10 years ago by Jim Stichnoth <stichnot@…>

I think the timing problem was actually introduced in 4fe1522fc8fd957f76fa3d82f0b9cecf7ad7748c. SubtitleScreen::Pulse() now always calls DisplayAVSubtitles() which has the side effect of resetting m_safeArea, and then SubtitleScreen::DisplayTextSubtitles?() and SubtitleScreen::DisplayCC608Subtitles() (and other places in subtitlescreen.cpp) continually find that m_safeArea has changed and execute some reinitialization path. This is especially noticeable in the log when SRT subtitles are displayed.

If I comment out the call to DisplayAVSubtitles(), the timing problem goes away, though the frame dropping problem remains.

I tried reverting the cc608decoder.cpp portions of d526385aa4c1466b064e9544cdb663f357007e35 but didn't see any difference in my test recording.

comment:3 Changed 10 years ago by Github

Subtitles: Fix a regression in display performance.

Refs #10111. Thanks to Jim Stichnoth for identifying the problem.

Branch: master Changeset: 96eabe4c7dc1d96c76cb7480a253073b1bf473de

comment:4 Changed 10 years ago by Jim Stichnoth <stichnot@…>

Regarding the frame dropping problem. By using "git bisect", it looks like the problem may have been introduced in [8f757eeaf]. If I revert that checkin (along with subsequent checkins [5787e9c52], [6ac09f0cd], and [3c441c2c2]), the frame dropping appears to go away.

I haven't dug into the MythUIText changes, but I suspect that calculating the text layout has become substantially more expensive, such that laying out all the portions of a caption exceeds the frame time. Especially on an ION/Atom frontend. (Each newline or color/italics/underline change results in an additional MythUIText object.)

Maybe there's a way to use MythUIText objects for captions that avoids the new expense in [8f757eeaf]?

comment:5 Changed 10 years ago by jpoet

Jim, I have made some minor optimizations to the MythUI code. Can you re-test and see if there is any improvement?

comment:6 Changed 10 years ago by jpoet

Jim, I have changed the CC code back to using a "simplified" MythUI text class. This should solve your problem.

comment:7 Changed 10 years ago by Jim Stichnoth <stichnot@…>

John -- the latest change fixes the frame dropping problem. Thanks!

Also thanks Mark for the timing fix.

From my point of view the ticket can be closed.

comment:8 Changed 10 years ago by markk

Resolution: Fixed
Status: assignedclosed

Reported as fixed. Thanks all.

Note: See TracTickets for help on using tickets.