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
6ebcac38
authored
Oct 14, 2019
by
ibaker
Committed by
Oliver Woodman
Oct 14, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Remove DefaultHlsExtractorFactory from null-checking blacklist
PiperOrigin-RevId: 274537528
parent
b71b9f7c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
13 deletions
library/hls/src/main/java/com/google/android/exoplayer2/source/hls/DefaultHlsExtractorFactory.java
library/hls/src/main/java/com/google/android/exoplayer2/source/hls/DefaultHlsExtractorFactory.java
View file @
6ebcac38
...
@@ -185,8 +185,8 @@ public final class DefaultHlsExtractorFactory implements HlsExtractorFactory {
...
@@ -185,8 +185,8 @@ public final class DefaultHlsExtractorFactory implements HlsExtractorFactory {
private
Extractor
createExtractorByFileExtension
(
private
Extractor
createExtractorByFileExtension
(
Uri
uri
,
Uri
uri
,
Format
format
,
Format
format
,
List
<
Format
>
muxedCaptionFormats
,
@Nullable
List
<
Format
>
muxedCaptionFormats
,
DrmInitData
drmInitData
,
@Nullable
DrmInitData
drmInitData
,
TimestampAdjuster
timestampAdjuster
)
{
TimestampAdjuster
timestampAdjuster
)
{
String
lastPathSegment
=
uri
.
getLastPathSegment
();
String
lastPathSegment
=
uri
.
getLastPathSegment
();
if
(
lastPathSegment
==
null
)
{
if
(
lastPathSegment
==
null
)
{
...
@@ -226,7 +226,7 @@ public final class DefaultHlsExtractorFactory implements HlsExtractorFactory {
...
@@ -226,7 +226,7 @@ public final class DefaultHlsExtractorFactory implements HlsExtractorFactory {
@DefaultTsPayloadReaderFactory
.
Flags
int
userProvidedPayloadReaderFactoryFlags
,
@DefaultTsPayloadReaderFactory
.
Flags
int
userProvidedPayloadReaderFactoryFlags
,
boolean
exposeCea608WhenMissingDeclarations
,
boolean
exposeCea608WhenMissingDeclarations
,
Format
format
,
Format
format
,
List
<
Format
>
muxedCaptionFormats
,
@Nullable
List
<
Format
>
muxedCaptionFormats
,
TimestampAdjuster
timestampAdjuster
)
{
TimestampAdjuster
timestampAdjuster
)
{
@DefaultTsPayloadReaderFactory
.
Flags
@DefaultTsPayloadReaderFactory
.
Flags
int
payloadReaderFactoryFlags
=
int
payloadReaderFactoryFlags
=
...
@@ -270,26 +270,34 @@ public final class DefaultHlsExtractorFactory implements HlsExtractorFactory {
...
@@ -270,26 +270,34 @@ public final class DefaultHlsExtractorFactory implements HlsExtractorFactory {
private
static
FragmentedMp4Extractor
createFragmentedMp4Extractor
(
private
static
FragmentedMp4Extractor
createFragmentedMp4Extractor
(
TimestampAdjuster
timestampAdjuster
,
TimestampAdjuster
timestampAdjuster
,
Format
format
,
Format
format
,
DrmInitData
drmInitData
,
@Nullable
DrmInitData
drmInitData
,
@Nullable
List
<
Format
>
muxedCaptionFormats
)
{
@Nullable
List
<
Format
>
muxedCaptionFormats
)
{
boolean
isVariant
=
false
;
for
(
int
i
=
0
;
i
<
format
.
metadata
.
length
();
i
++)
{
Metadata
.
Entry
entry
=
format
.
metadata
.
get
(
i
);
if
(
entry
instanceof
HlsTrackMetadataEntry
)
{
isVariant
=
!((
HlsTrackMetadataEntry
)
entry
).
variantInfos
.
isEmpty
();
break
;
}
}
// Only enable the EMSG TrackOutput if this is the 'variant' track (i.e. the main one) to avoid
// Only enable the EMSG TrackOutput if this is the 'variant' track (i.e. the main one) to avoid
// creating a separate EMSG track for every audio track in a video stream.
// creating a separate EMSG track for every audio track in a video stream.
return
new
FragmentedMp4Extractor
(
return
new
FragmentedMp4Extractor
(
/* flags= */
is
Variant
?
FragmentedMp4Extractor
.
FLAG_ENABLE_EMSG_TRACK
:
0
,
/* flags= */
is
Fmp4Variant
(
format
)
?
FragmentedMp4Extractor
.
FLAG_ENABLE_EMSG_TRACK
:
0
,
timestampAdjuster
,
timestampAdjuster
,
/* sideloadedTrack= */
null
,
/* sideloadedTrack= */
null
,
drmInitData
,
drmInitData
,
muxedCaptionFormats
!=
null
?
muxedCaptionFormats
:
Collections
.
emptyList
());
muxedCaptionFormats
!=
null
?
muxedCaptionFormats
:
Collections
.
emptyList
());
}
}
/** Returns true if this {@code format} represents a 'variant' track (i.e. the main one). */
private
static
boolean
isFmp4Variant
(
Format
format
)
{
Metadata
metadata
=
format
.
metadata
;
if
(
metadata
==
null
)
{
return
false
;
}
for
(
int
i
=
0
;
i
<
metadata
.
length
();
i
++)
{
Metadata
.
Entry
entry
=
metadata
.
get
(
i
);
if
(
entry
instanceof
HlsTrackMetadataEntry
)
{
return
!((
HlsTrackMetadataEntry
)
entry
).
variantInfos
.
isEmpty
();
}
}
return
false
;
}
@Nullable
private
static
Result
buildResultForSameExtractorType
(
private
static
Result
buildResultForSameExtractorType
(
Extractor
previousExtractor
,
Format
format
,
TimestampAdjuster
timestampAdjuster
)
{
Extractor
previousExtractor
,
Format
format
,
TimestampAdjuster
timestampAdjuster
)
{
if
(
previousExtractor
instanceof
WebvttExtractor
)
{
if
(
previousExtractor
instanceof
WebvttExtractor
)
{
...
...
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