-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
Starting at this line the code checks if a CEA608 control code was repeated:
ExoPlayer/library/core/src/main/java/com/google/android/exoplayer2/text/cea/Cea608Decoder.java
Line 339 in 2b20780
| boolean isRepeatableControl = isRepeatable(cc1); |
The problem is that it does not take into account the timing of the received control codes. There are contents that use the same control code multiple times consecutively, like the Sarnoff test streams required for FCC certification. Their content contains the following commands:
02-15 10:32:03.888 MISC: RESUME_CAPTION_LOADING
02-15 10:32:03.938 MISC: ERASE_DISPLAYED_MEMORY
02-15 10:32:03.978 MISC: ERASE_NON_DISPLAYED_MEMORY
02-15 10:32:04.008 PAC: Row:11; Col:1; Color:WHITE; italic:false; underline:false
02-15 10:32:04.568 PAC: Row:12; Col:1; Color:WHITE; italic:false; underline:false
02-15 10:32:05.529 MISC: END_OF_CAPTION
02-15 10:32:05.869 MISC: END_OF_CAPTION // Dropped
02-15 10:32:06.210 MISC: END_OF_CAPTION
02-15 10:32:06.540 MISC: END_OF_CAPTION // Dropped
02-15 10:32:06.870 MISC: END_OF_CAPTION
...
Note: According to the standard END_OF_CAPTION flips the visible and hidden caption buffers, so it should make the 2 lines repeatedly visible then hidden again: effectively blinking in this case.
The current implementation drops every second command of this content.
According to https://www.law.cornell.edu/cfr/text/47/79.101
If the first transmission of a control code pair passes parity, it is acted upon within one video frame. If the next frame contains a perfect repeat of the same pair, the redundant code is ignored.
So the check should only drop control codes if they are in consecutive video frames immediately after each other.