Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#7775 closed patch (fixed)

Various fixes for EIA-708 (ATSC) closed captions

Reported by: Clayton Smith <argilo@…> Owned by: danielk
Priority: minor Milestone: unknown
Component: MythTV - Video Playback Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

The attached patch fixes various bugs in the EIA-708 (ATSC) closed captioning implementation. The bugs are as follows:

  1. The DisplayWindows? command does not take effect immediately, so caption windows don't appear until a later command triggers a redraw. To fix this, I added a call to CC708Updated() to the end of NuppelVideoPlayer::DisplayWindows?.
  1. Caption windows which are not set as visible get drawn anyway, resulting in overlapping text on shows that alternate between two caption windows. To fix this, I added "if (!win.visible) return;" to the start of OSDType708CC::Draw.
  1. On many shows, only the last line of captions is ever visible. After some investigation, I found that this occurs because captions are written into a hidden window which is initially defined (with DefineWindow?) to have only one row. Then, as each line is added, DefineWindow? is called to expand the window by one row. But the current DefineWindow? implementation deletes all text in a window upon resizing. So I modified CC708Window::DefineWindow? to keep the existing text whenever the number of rows is increased, and now all rows of text are visible.
  1. When a character is printed in the rightmost column of a caption window, the pen always moves to the beginning of the next line. But as far as I can tell from the CEA-708 Wikipedia page, this is only supposed to happen when the column lock is set and the row lock is not set. This bug causes extra blank lines to be inserted into scrolling captions, and causes some rows of non-scrolling captions to disappear. I have fixed this by adding !row_lock and column_lock conditions to CC708Window::IncrPenLocation?.

After making these four changes, closed captions are finally working in all my shows.

Attachments (1)

various-caption-fixes.patch (2.6 KB) - added by Clayton Smith <argilo@…> 10 years ago.
Various fixes to EIA-708 closed caption code

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by Clayton Smith <argilo@…>

Attachment: various-caption-fixes.patch added

Various fixes to EIA-708 closed caption code

comment:1 Changed 10 years ago by Clayton Smith <argilo@…>

Oops, I forgot to set the component to "MythTV - ATSC" but I can't see any way to change it now.

comment:2 Changed 10 years ago by danielk

Component: MythTV - GeneralMythTV - Video Playback
Owner: changed from Isaac Richards to danielk
Status: newassigned

comment:3 Changed 10 years ago by danielk

Resolution: fixed
Status: assignedclosed

(In [23029]) Fixes #7775. Various CEA-708 fixes.

comment:4 Changed 10 years ago by Clayton Smith <argilo@…>

Should this (as well as #7738, #7739 and #7766) not be backported into 0.22-fixes, seeing as they are all bug fixes? I actually developed and tested my patches (and still use them) on the 0.22-fixes branch, so I know they work well there.

Note: See TracTickets for help on using tickets.