From d42c58f152eb954d858f47e4b178ebea4891a052 Mon Sep 17 00:00:00 2001 From: ibaker Date: Wed, 16 Aug 2023 16:58:00 +0100 Subject: [PATCH] Fix `DvbParser` handling of `pageComposition = null` This `DvbParser` was updated to implement the new `SubtitleParser` interface in https://github.com/androidx/media/commit/2261756d3a3943fb936c2887c0d85b2d61b3de62. This method used to return a `List`, but now it returns a `List`, which is closer to `List>`. The previous method returned an empty list, meaning a single 'event' with no cues. After the change above the method still returns an empty list, but that now means 'no events'. In order to maintain the old behaviour, this change updates it to return a single-item list containing an empty list of cues. PiperOrigin-RevId: 557502261 --- .../java/androidx/media3/extractor/text/dvb/DvbParser.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/extractor/src/main/java/androidx/media3/extractor/text/dvb/DvbParser.java b/libraries/extractor/src/main/java/androidx/media3/extractor/text/dvb/DvbParser.java index 0ba7da8bfc..400710e5eb 100644 --- a/libraries/extractor/src/main/java/androidx/media3/extractor/text/dvb/DvbParser.java +++ b/libraries/extractor/src/main/java/androidx/media3/extractor/text/dvb/DvbParser.java @@ -139,7 +139,9 @@ public final class DvbParser implements SubtitleParser { @Nullable PageComposition pageComposition = subtitleService.pageComposition; if (pageComposition == null) { - return ImmutableList.of(); + return ImmutableList.of( + new CuesWithTiming( + ImmutableList.of(), /* startTimeUs= */ C.TIME_UNSET, /* durationUs= */ C.TIME_UNSET)); } // Update the canvas bitmap if necessary.