Skip to content

Commit

Permalink
Code improvements
Browse files Browse the repository at this point in the history
* Throw ContentNotSupportedExceptions when extracting (as was done before)
  • Loading branch information
litetex committed Aug 26, 2022
1 parent 80d0baa commit 81dea3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ public String generateManifest() {
// Get all durations and repetitions which are separated by a comma
.split(",");
final int lastIndex = segmentsAndDurationsResponseSplit.length - 1;
if (isBlank(segmentsAndDurationsResponseSplit[lastIndex])) {
segmentDurations = Arrays.copyOf(segmentsAndDurationsResponseSplit, lastIndex);
} else {
segmentDurations = segmentsAndDurationsResponseSplit;
}
segmentDurations = isBlank(segmentsAndDurationsResponseSplit[lastIndex])
? Arrays.copyOf(segmentsAndDurationsResponseSplit, lastIndex)
: segmentsAndDurationsResponseSplit;
} catch (final Exception e) {
throw new DashManifestCreationException("Could not get segment durations", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -523,13 +523,17 @@ private static void extractStreams(final StreamInfo streamInfo,
/* Extract video stream url */
try {
streamInfo.setVideoStreams(extractor.getVideoStreams());
} catch (final ContentNotSupportedException e) {
throw e;
} catch (final Exception e) {
streamInfo.addError(new ExtractionException("Couldn't get video streams", e));
}

/* Extract video only stream url */
try {
streamInfo.setVideoOnlyStreams(extractor.getVideoOnlyStreams());
} catch (final ContentNotSupportedException e) {
throw e;
} catch (final Exception e) {
streamInfo.addError(new ExtractionException("Couldn't get video only streams", e));
}
Expand Down

0 comments on commit 81dea3c

Please sign in to comment.