Repository navigation
Conversation
A mid-row code is a spacing attribute: it takes up one column and shows
as a space. ccMIDROW only changed the pen, so the next character was
written where the code should be ("Hi" + italics + "there" gave
"Hithere") and the rest of the row was one column off.
Write a space with the new pen after setting it, through insertChars so
paint-on and roll-up captions update too.
Fixes video-dev#8147
|
I ran into some Github permission issues for forked branches. I created a PR with your authored commits here: #8166 |
|
I saw #8166 got closed. Is there anything I can do on this one to help it land? The branch is up to date with master, and the only red check is the optional Firefox functional job. Happy to rebase or change anything. |
I had to open the other PR to run the CI temporarily. I see the CI failure was due to a timeout, so there should be nothing more you need to do at this time. I talked with @robwalch about it since it was surprising I could not run the functional tests. |
This PR will...
Make CEA-608 mid-row codes (color / italics / underline changes inside a row) take up one column and show as a space.
Why is this Pull Request needed?
Cea608Channel.ccMIDROWonly calledsetPen(). In CEA-608 a mid-row code is a spacing attribute: it is shown as if a standard space (0x20) had been received (47 CFR 79.101). Because the cursor did not move, the next character was written in the column of the code, soHi+ italics +therecame out asHithere, and every later character on the row was one column to the left. FFmpeg, mux.js and pycaption all giveHi therefor the issue's caption data.The fix writes a space with the new pen right after
setPen()(same order as FFmpeg'shandle_textattr). It goes throughinsertChars([0x20]), not justmoveCursor(1), so:Are there any points in the code the reviewer needs to double check?
cues.tsthat counts as 1 column of indent, which rounds to the same cue position as before (floor(1 * 8 / 32) = 0), and the cue text is trimmed.ccFON) is also a spacing attribute in the spec, but I left it alone to keep this PR to the reported bug.Resolves issues:
Fixes #8147
Checklist
Tests: 3 new cases in
tests/unit/utils/cea-608-parser.ts(the issue's data, a color mid-row code, and a paint-on overwrite). All 3 fail on master and pass with the fix.npm run test:unit1286 passing;eslint,prettier --checkandtype-checkclean.