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
6cff8a6a
authored
Apr 14, 2020
by
olly
Committed by
Ian Baker
Apr 15, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Don't select trick-play tracks by default
Issue: #6054 Issue: #474 PiperOrigin-RevId: 306504362
parent
a99288a6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
library/common/src/main/java/com/google/android/exoplayer2/C.java
library/core/src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java
library/common/src/main/java/com/google/android/exoplayer2/C.java
View file @
6cff8a6a
...
@@ -998,7 +998,8 @@ public final class C {
...
@@ -998,7 +998,8 @@ public final class C {
* #ROLE_FLAG_DUB}, {@link #ROLE_FLAG_EMERGENCY}, {@link #ROLE_FLAG_CAPTION}, {@link
* #ROLE_FLAG_DUB}, {@link #ROLE_FLAG_EMERGENCY}, {@link #ROLE_FLAG_CAPTION}, {@link
* #ROLE_FLAG_SUBTITLE}, {@link #ROLE_FLAG_SIGN}, {@link #ROLE_FLAG_DESCRIBES_VIDEO}, {@link
* #ROLE_FLAG_SUBTITLE}, {@link #ROLE_FLAG_SIGN}, {@link #ROLE_FLAG_DESCRIBES_VIDEO}, {@link
* #ROLE_FLAG_DESCRIBES_MUSIC_AND_SOUND}, {@link #ROLE_FLAG_ENHANCED_DIALOG_INTELLIGIBILITY},
* #ROLE_FLAG_DESCRIBES_MUSIC_AND_SOUND}, {@link #ROLE_FLAG_ENHANCED_DIALOG_INTELLIGIBILITY},
* {@link #ROLE_FLAG_TRANSCRIBES_DIALOG} and {@link #ROLE_FLAG_EASY_TO_READ}.
* {@link #ROLE_FLAG_TRANSCRIBES_DIALOG}, {@link #ROLE_FLAG_EASY_TO_READ} and {@link
* #ROLE_FLAG_TRICK_PLAY}.
*/
*/
@Documented
@Documented
@Retention
(
RetentionPolicy
.
SOURCE
)
@Retention
(
RetentionPolicy
.
SOURCE
)
...
@@ -1018,7 +1019,8 @@ public final class C {
...
@@ -1018,7 +1019,8 @@ public final class C {
ROLE_FLAG_DESCRIBES_MUSIC_AND_SOUND
,
ROLE_FLAG_DESCRIBES_MUSIC_AND_SOUND
,
ROLE_FLAG_ENHANCED_DIALOG_INTELLIGIBILITY
,
ROLE_FLAG_ENHANCED_DIALOG_INTELLIGIBILITY
,
ROLE_FLAG_TRANSCRIBES_DIALOG
,
ROLE_FLAG_TRANSCRIBES_DIALOG
,
ROLE_FLAG_EASY_TO_READ
ROLE_FLAG_EASY_TO_READ
,
ROLE_FLAG_TRICK_PLAY
})
})
public
@interface
RoleFlags
{}
public
@interface
RoleFlags
{}
/** Indicates a main track. */
/** Indicates a main track. */
...
@@ -1064,6 +1066,8 @@ public final class C {
...
@@ -1064,6 +1066,8 @@ public final class C {
public
static
final
int
ROLE_FLAG_TRANSCRIBES_DIALOG
=
1
<<
12
;
public
static
final
int
ROLE_FLAG_TRANSCRIBES_DIALOG
=
1
<<
12
;
/** Indicates the track contains a text that has been edited for ease of reading. */
/** Indicates the track contains a text that has been edited for ease of reading. */
public
static
final
int
ROLE_FLAG_EASY_TO_READ
=
1
<<
13
;
public
static
final
int
ROLE_FLAG_EASY_TO_READ
=
1
<<
13
;
/** Indicates the track is intended for trick play. */
public
static
final
int
ROLE_FLAG_TRICK_PLAY
=
1
<<
14
;
/**
/**
* Converts a time in microseconds to the corresponding time in milliseconds, preserving
* Converts a time in microseconds to the corresponding time in milliseconds, preserving
...
...
library/core/src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java
View file @
6cff8a6a
...
@@ -1888,6 +1888,10 @@ public class DefaultTrackSelector extends MappingTrackSelector {
...
@@ -1888,6 +1888,10 @@ public class DefaultTrackSelector extends MappingTrackSelector {
int
maxVideoHeight
,
int
maxVideoHeight
,
int
maxVideoFrameRate
,
int
maxVideoFrameRate
,
int
maxVideoBitrate
)
{
int
maxVideoBitrate
)
{
if
((
format
.
roleFlags
&
C
.
ROLE_FLAG_TRICK_PLAY
)
!=
0
)
{
// Ignore trick-play tracks for now.
return
false
;
}
return
isSupported
(
formatSupport
,
false
)
return
isSupported
(
formatSupport
,
false
)
&&
((
formatSupport
&
requiredAdaptiveSupport
)
!=
0
)
&&
((
formatSupport
&
requiredAdaptiveSupport
)
!=
0
)
&&
(
mimeType
==
null
||
Util
.
areEqual
(
format
.
sampleMimeType
,
mimeType
))
&&
(
mimeType
==
null
||
Util
.
areEqual
(
format
.
sampleMimeType
,
mimeType
))
...
@@ -1911,9 +1915,13 @@ public class DefaultTrackSelector extends MappingTrackSelector {
...
@@ -1911,9 +1915,13 @@ public class DefaultTrackSelector extends MappingTrackSelector {
params
.
viewportWidth
,
params
.
viewportHeight
,
params
.
viewportOrientationMayChange
);
params
.
viewportWidth
,
params
.
viewportHeight
,
params
.
viewportOrientationMayChange
);
@Capabilities
int
[]
trackFormatSupport
=
formatSupports
[
groupIndex
];
@Capabilities
int
[]
trackFormatSupport
=
formatSupports
[
groupIndex
];
for
(
int
trackIndex
=
0
;
trackIndex
<
trackGroup
.
length
;
trackIndex
++)
{
for
(
int
trackIndex
=
0
;
trackIndex
<
trackGroup
.
length
;
trackIndex
++)
{
Format
format
=
trackGroup
.
getFormat
(
trackIndex
);
if
((
format
.
roleFlags
&
C
.
ROLE_FLAG_TRICK_PLAY
)
!=
0
)
{
// Ignore trick-play tracks for now.
continue
;
}
if
(
isSupported
(
trackFormatSupport
[
trackIndex
],
if
(
isSupported
(
trackFormatSupport
[
trackIndex
],
params
.
exceedRendererCapabilitiesIfNecessary
))
{
params
.
exceedRendererCapabilitiesIfNecessary
))
{
Format
format
=
trackGroup
.
getFormat
(
trackIndex
);
boolean
isWithinConstraints
=
boolean
isWithinConstraints
=
selectedTrackIndices
.
contains
(
trackIndex
)
selectedTrackIndices
.
contains
(
trackIndex
)
&&
(
format
.
width
==
Format
.
NO_VALUE
||
format
.
width
<=
params
.
maxVideoWidth
)
&&
(
format
.
width
==
Format
.
NO_VALUE
||
format
.
width
<=
params
.
maxVideoWidth
)
...
...
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