mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
When multiple BaseURL elements are present, prefer the first one.
Issue: #771
This commit is contained in:
parent
4a29be498b
commit
a7ba393d54
1 changed files with 20 additions and 4 deletions
|
|
@ -117,10 +117,14 @@ public class MediaPresentationDescriptionParser extends DefaultHandler
|
||||||
List<Period> periods = new ArrayList<>();
|
List<Period> periods = new ArrayList<>();
|
||||||
long nextPeriodStartMs = dynamic ? -1 : 0;
|
long nextPeriodStartMs = dynamic ? -1 : 0;
|
||||||
boolean seenEarlyAccessPeriod = false;
|
boolean seenEarlyAccessPeriod = false;
|
||||||
|
boolean seenFirstBaseUrl = false;
|
||||||
do {
|
do {
|
||||||
xpp.next();
|
xpp.next();
|
||||||
if (isStartTag(xpp, "BaseURL")) {
|
if (isStartTag(xpp, "BaseURL")) {
|
||||||
baseUrl = parseBaseUrl(xpp, baseUrl);
|
if (!seenFirstBaseUrl) {
|
||||||
|
baseUrl = parseBaseUrl(xpp, baseUrl);
|
||||||
|
seenFirstBaseUrl = true;
|
||||||
|
}
|
||||||
} else if (isStartTag(xpp, "UTCTiming")) {
|
} else if (isStartTag(xpp, "UTCTiming")) {
|
||||||
utcTiming = parseUtcTiming(xpp);
|
utcTiming = parseUtcTiming(xpp);
|
||||||
} else if (isStartTag(xpp, "Location")) {
|
} else if (isStartTag(xpp, "Location")) {
|
||||||
|
|
@ -183,10 +187,14 @@ public class MediaPresentationDescriptionParser extends DefaultHandler
|
||||||
long durationMs = parseDuration(xpp, "duration", -1);
|
long durationMs = parseDuration(xpp, "duration", -1);
|
||||||
SegmentBase segmentBase = null;
|
SegmentBase segmentBase = null;
|
||||||
List<AdaptationSet> adaptationSets = new ArrayList<>();
|
List<AdaptationSet> adaptationSets = new ArrayList<>();
|
||||||
|
boolean seenFirstBaseUrl = false;
|
||||||
do {
|
do {
|
||||||
xpp.next();
|
xpp.next();
|
||||||
if (isStartTag(xpp, "BaseURL")) {
|
if (isStartTag(xpp, "BaseURL")) {
|
||||||
baseUrl = parseBaseUrl(xpp, baseUrl);
|
if (!seenFirstBaseUrl) {
|
||||||
|
baseUrl = parseBaseUrl(xpp, baseUrl);
|
||||||
|
seenFirstBaseUrl = true;
|
||||||
|
}
|
||||||
} else if (isStartTag(xpp, "AdaptationSet")) {
|
} else if (isStartTag(xpp, "AdaptationSet")) {
|
||||||
adaptationSets.add(parseAdaptationSet(xpp, baseUrl, segmentBase));
|
adaptationSets.add(parseAdaptationSet(xpp, baseUrl, segmentBase));
|
||||||
} else if (isStartTag(xpp, "SegmentBase")) {
|
} else if (isStartTag(xpp, "SegmentBase")) {
|
||||||
|
|
@ -223,10 +231,14 @@ public class MediaPresentationDescriptionParser extends DefaultHandler
|
||||||
|
|
||||||
ContentProtectionsBuilder contentProtectionsBuilder = new ContentProtectionsBuilder();
|
ContentProtectionsBuilder contentProtectionsBuilder = new ContentProtectionsBuilder();
|
||||||
List<Representation> representations = new ArrayList<>();
|
List<Representation> representations = new ArrayList<>();
|
||||||
|
boolean seenFirstBaseUrl = false;
|
||||||
do {
|
do {
|
||||||
xpp.next();
|
xpp.next();
|
||||||
if (isStartTag(xpp, "BaseURL")) {
|
if (isStartTag(xpp, "BaseURL")) {
|
||||||
baseUrl = parseBaseUrl(xpp, baseUrl);
|
if (!seenFirstBaseUrl) {
|
||||||
|
baseUrl = parseBaseUrl(xpp, baseUrl);
|
||||||
|
seenFirstBaseUrl = true;
|
||||||
|
}
|
||||||
} else if (isStartTag(xpp, "ContentProtection")) {
|
} else if (isStartTag(xpp, "ContentProtection")) {
|
||||||
contentProtectionsBuilder.addAdaptationSetProtection(parseContentProtection(xpp));
|
contentProtectionsBuilder.addAdaptationSetProtection(parseContentProtection(xpp));
|
||||||
} else if (isStartTag(xpp, "ContentComponent")) {
|
} else if (isStartTag(xpp, "ContentComponent")) {
|
||||||
|
|
@ -352,10 +364,14 @@ public class MediaPresentationDescriptionParser extends DefaultHandler
|
||||||
int audioSamplingRate = parseInt(xpp, "audioSamplingRate", adaptationSetAudioSamplingRate);
|
int audioSamplingRate = parseInt(xpp, "audioSamplingRate", adaptationSetAudioSamplingRate);
|
||||||
String language = adaptationSetLanguage;
|
String language = adaptationSetLanguage;
|
||||||
|
|
||||||
|
boolean seenFirstBaseUrl = false;
|
||||||
do {
|
do {
|
||||||
xpp.next();
|
xpp.next();
|
||||||
if (isStartTag(xpp, "BaseURL")) {
|
if (isStartTag(xpp, "BaseURL")) {
|
||||||
baseUrl = parseBaseUrl(xpp, baseUrl);
|
if (!seenFirstBaseUrl) {
|
||||||
|
baseUrl = parseBaseUrl(xpp, baseUrl);
|
||||||
|
seenFirstBaseUrl = true;
|
||||||
|
}
|
||||||
} else if (isStartTag(xpp, "AudioChannelConfiguration")) {
|
} else if (isStartTag(xpp, "AudioChannelConfiguration")) {
|
||||||
audioChannels = parseAudioChannelConfiguration(xpp);
|
audioChannels = parseAudioChannelConfiguration(xpp);
|
||||||
} else if (isStartTag(xpp, "SegmentBase")) {
|
} else if (isStartTag(xpp, "SegmentBase")) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue