mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Tighten the handling of validDataChannelTimeoutMs in Cea608Parser
This matches the documented requirements for this parameter. PiperOrigin-RevId: 589799256
This commit is contained in:
parent
00c7a9bcbb
commit
379cb3ba54
1 changed files with 7 additions and 2 deletions
|
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
package androidx.media3.extractor.text.cea;
|
package androidx.media3.extractor.text.cea;
|
||||||
|
|
||||||
|
import static androidx.media3.common.util.Assertions.checkArgument;
|
||||||
import static java.lang.Math.min;
|
import static java.lang.Math.min;
|
||||||
|
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
|
@ -369,8 +370,12 @@ public final class Cea608Parser implements SubtitleParser {
|
||||||
cueBuilders = new ArrayList<>();
|
cueBuilders = new ArrayList<>();
|
||||||
currentCueBuilder = new CueBuilder(CC_MODE_UNKNOWN, DEFAULT_CAPTIONS_ROW_COUNT);
|
currentCueBuilder = new CueBuilder(CC_MODE_UNKNOWN, DEFAULT_CAPTIONS_ROW_COUNT);
|
||||||
currentChannel = NTSC_CC_CHANNEL_1;
|
currentChannel = NTSC_CC_CHANNEL_1;
|
||||||
this.validDataChannelTimeoutUs =
|
if (validDataChannelTimeoutMs != C.TIME_UNSET) {
|
||||||
validDataChannelTimeoutMs > 0 ? validDataChannelTimeoutMs * 1000 : C.TIME_UNSET;
|
checkArgument(validDataChannelTimeoutMs >= MIN_DATA_CHANNEL_TIMEOUT_MS);
|
||||||
|
this.validDataChannelTimeoutUs = validDataChannelTimeoutMs * 1000;
|
||||||
|
} else {
|
||||||
|
this.validDataChannelTimeoutUs = C.TIME_UNSET;
|
||||||
|
}
|
||||||
packetLength = MimeTypes.APPLICATION_MP4CEA608.equals(mimeType) ? 2 : 3;
|
packetLength = MimeTypes.APPLICATION_MP4CEA608.equals(mimeType) ? 2 : 3;
|
||||||
switch (accessibilityChannel) {
|
switch (accessibilityChannel) {
|
||||||
case 1:
|
case 1:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue