Modify

Ticket #7775 (closed patch: fixed)

You must read the TicketHowTo before creating a new ticket or commenting on an existing ticket.

Opened 2 years ago

Last modified 2 years ago

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

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

Change History

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

Various fixes to EIA-708 closed caption code

comment:1 Changed 2 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 2 years ago by danielk

  • Owner changed from ijr to danielk
  • Status changed from new to assigned
  • Component changed from MythTV - General to MythTV - Video Playback

comment:3 Changed 2 years ago by danielk

  • Status changed from assigned to closed
  • Resolution set to fixed

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

comment:4 Changed 2 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.

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.