Opened 10 years ago

Closed 10 years ago

#7739 closed defect (fixed)

Backspace is not supported in EIA-708 (ATSC) closed captions

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

Description

At least one ATSC station I watch transmits the backspace (0x08) character in its EIA-708 closed captions. Currently MythTV does not handle this correctly. It prints out a box, rather than erasing the previous character. I have patched this by making a small addition to CC708Window::AddChar?.

Attachments (2)

backspace-eia-708.patch (493 bytes) - added by Clayton Smith <argilo@…> 10 years ago.
Add support for backspaces in EIA-708 closed captions
backspace-eia-708-2.patch (2.3 KB) - added by Clayton Smith <argilo@…> 10 years ago.
Another attempt at adding support for backspaces in EIA-708 closed captions

Download all attachments as: .zip

Change History (9)

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

Attachment: backspace-eia-708.patch added

Add support for backspaces in EIA-708 closed captions

comment:1 Changed 10 years ago by danielk

Type: patchdefect

Clayton, two things. One this does not check if the column is already 0. I'm not sure if we should go back to the previous row in that case, but we shouldn't try to go to column -1. Second there is a note in CC708Window::Scroll() "TODO implement other 3 scroll directions..." I'm wondering if those need to be implemented to handle this correctly..

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

Without the spec it's hard to know what to do. This patch at least fixes the cases that show up on one channel I watch. Would it be enough to add an extra condition (pen.column > 0) to the if statement for now?

comment:3 Changed 10 years ago by danielk

Backspace should probably go in the opposite direction of the current scroll direction. Who are these clowns sending a backspace character in captions anyway?!?

So to implement add a DecrPenLocation?() that does the opposite of what IncrPenLocation?() does, then when IncrPenLocation?() is expanded to handle all the scroll directions DecrPenLocation?() can be updated as well. Also, after calling DecrPenLocation?() set the character under the pen location to a space, to mimic what happens in an editor. That should handle LeftToRight? text in addition to RightToLeft?, and both TopToBottom? and BottomToTop? scrolling.

This is a good reference for the standard:

http://en.wikipedia.org/wiki/CEA-708

comment:4 in reply to:  3 ; Changed 10 years ago by skd5aner <skd5aner@…>

Replying to danielk:

Backspace should probably go in the opposite direction of the current scroll direction. Who are these clowns sending a backspace character in captions anyway?!?

danielk - I believe during live events, the folks who type up the captions will often times delete typos as they try and keep up and then re-enter the correct word. So the typo will be sent, displayed, then removed, and replaced.

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

Attachment: backspace-eia-708-2.patch added

Another attempt at adding support for backspaces in EIA-708 closed captions

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

Daniel, I've attached a patch that fixes this as you suggested, and it handles all my programs that have backspaces.

The new DecrPenLocation? function is just a copy of IncrPenLocation?, but with += changed to -= at the beginning. Note that since I patched IncrPenLocation? in Ticket #7775, the DecrPenLocation? function in this patch includes the additional !row_lock and column_lock checks that I added there.

comment:6 in reply to:  4 Changed 10 years ago by Clayton Smith <argilo@…>

Replying to skd5aner <skd5aner@…>:

Replying to danielk:

Backspace should probably go in the opposite direction of the current scroll direction. Who are these clowns sending a backspace character in captions anyway?!?

danielk - I believe during live events, the folks who type up the captions will often times delete typos as they try and keep up and then re-enter the correct word. So the typo will be sent, displayed, then removed, and replaced.

Actually, I see backspaces in pre-recorded shows too. In a couple shows, every apostrophe is sent out as apostrophe-backspace-apostrophe. In another show, some (but not all) accented French letters are set out without the accent first, then backspaced, and sent again with the accent. Weird!

comment:7 Changed 10 years ago by danielk

Resolution: fixed
Status: newclosed

(In [22996]) Fixes #7739. Handle backspace in CEA-708 captions.

Note: See TracTickets for help on using tickets.