Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a7ba393d
authored
Sep 10, 2015
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
When multiple BaseURL elements are present, prefer the first one.
Issue: #771
parent
4a29be49
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
library/src/main/java/com/google/android/exoplayer/dash/mpd/MediaPresentationDescriptionParser.java
library/src/main/java/com/google/android/exoplayer/dash/mpd/MediaPresentationDescriptionParser.java
View file @
a7ba393d
...
@@ -117,10 +117,14 @@ public class MediaPresentationDescriptionParser extends DefaultHandler
...
@@ -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
...
@@ -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
...
@@ -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
...
@@ -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"
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment