Skip to content

Commit 6aa35aa

Browse files
authored
Merge pull request google#6790 from google/dev-v2-r2.11.1
r2.11.1
2 parents 76962d5 + 27e4855 commit 6aa35aa

File tree

46 files changed

+1595
-269
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1595
-269
lines changed

RELEASENOTES.md

+30
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Release notes #
22

3+
### 2.11.1 (2019-12-20) ###
4+
5+
* UI: Exclude `DefaultTimeBar` region from system gesture detection
6+
([#6685](https://github.com/google/ExoPlayer/issues/6685)).
7+
* ProGuard fixes:
8+
* Ensure `Libgav1VideoRenderer` constructor is kept for use by
9+
`DefaultRenderersFactory`
10+
([#6773](https://github.com/google/ExoPlayer/issues/6773)).
11+
* Ensure `VideoDecoderOutputBuffer` and its members are kept for use by video
12+
decoder extensions.
13+
* Ensure raw resources used with `RawResourceDataSource` are kept.
14+
* Suppress spurious warnings about the `javax.annotation` package, and
15+
restructure use of `IntDef` annotations to remove spurious warnings about
16+
`SsaStyle$SsaAlignment`
17+
([#6771](https://github.com/google/ExoPlayer/issues/6771)).
18+
* Fix `CacheDataSource` to correctly propagate `DataSpec.httpRequestHeaders`.
19+
* Fix issue with `DefaultDownloadIndex` that could result in an
20+
`IllegalStateException` being thrown from
21+
`DefaultDownloadIndex.getDownloadForCurrentRow`
22+
([#6785](https://github.com/google/ExoPlayer/issues/6785)).
23+
* Fix `IndexOutOfBoundsException` in `SinglePeriodTimeline.getWindow`
24+
([#6776](https://github.com/google/ExoPlayer/issues/6776)).
25+
* Add missing `@Nullable` to `MediaCodecAudioRenderer.getMediaClock` and
26+
`SimpleDecoderAudioRenderer.getMediaClock`
27+
([#6792](https://github.com/google/ExoPlayer/issues/6792)).
28+
329
### 2.11.0 (2019-12-11) ###
430

531
* Core library:
@@ -30,6 +56,10 @@
3056
* Fix issue where player errors are thrown too early at playlist transitions
3157
([#5407](https://github.com/google/ExoPlayer/issues/5407)).
3258
* Add `Format` and renderer support flags to renderer `ExoPlaybackException`s.
59+
* Where there are multiple platform decoders for a given MIME type, prefer to
60+
use one that advertises support for the profile and level of the media being
61+
played over one that does not, even if it does not come first in the
62+
`MediaCodecList`.
3363
* DRM:
3464
* Inject `DrmSessionManager` into the `MediaSources` instead of `Renderers`.
3565
This allows each `MediaSource` in a `ConcatenatingMediaSource` to use a

constants.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// limitations under the License.
1414
project.ext {
1515
// ExoPlayer version and version code.
16-
releaseVersion = '2.11.0'
17-
releaseVersionCode = 2011000
16+
releaseVersion = '2.11.1'
17+
releaseVersionCode = 2011001
1818
minSdkVersion = 16
1919
appTargetSdkVersion = 29
2020
targetSdkVersion = 28 // TODO: Bump once b/143232359 is resolved

extensions/av1/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ a custom track selector the choice of `Renderer` is up to your implementation.
9696
You need to make sure you are passing a `Libgav1VideoRenderer` to the player and
9797
then you need to implement your own logic to use the renderer for a given track.
9898

99+
## Using the extension in the demo application ##
100+
101+
To try out playback using the extension in the [demo application][], see
102+
[enabling extension decoders][].
103+
104+
[demo application]: https://exoplayer.dev/demo-application.html
105+
[enabling extension decoders]: https://exoplayer.dev/demo-application.html#enabling-extension-decoders
106+
99107
## Rendering options ##
100108

101109
There are two possibilities for rendering the output `Libgav1VideoRenderer`

extensions/ffmpeg/README.md

+10
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,19 @@ then implement your own logic to use the renderer for a given track.
106106
[#2781]: https://github.com/google/ExoPlayer/issues/2781
107107
[Supported formats]: https://exoplayer.dev/supported-formats.html#ffmpeg-extension
108108

109+
## Using the extension in the demo application ##
110+
111+
To try out playback using the extension in the [demo application][], see
112+
[enabling extension decoders][].
113+
114+
[demo application]: https://exoplayer.dev/demo-application.html
115+
[enabling extension decoders]: https://exoplayer.dev/demo-application.html#enabling-extension-decoders
116+
109117
## Links ##
110118

119+
* [Troubleshooting using extensions][]
111120
* [Javadoc][]: Classes matching `com.google.android.exoplayer2.ext.ffmpeg.*`
112121
belong to this module.
113122

123+
[Troubleshooting using extensions]: https://exoplayer.dev/troubleshooting.html#how-can-i-get-a-decoding-extension-to-load-and-be-used-for-playback
114124
[Javadoc]: https://exoplayer.dev/doc/reference/index.html

extensions/flac/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ a custom track selector the choice of `Renderer` is up to your implementation,
9797
so you need to make sure you are passing an `LibflacAudioRenderer` to the
9898
player, then implement your own logic to use the renderer for a given track.
9999

100+
## Using the extension in the demo application ##
101+
102+
To try out playback using the extension in the [demo application][], see
103+
[enabling extension decoders][].
104+
105+
[demo application]: https://exoplayer.dev/demo-application.html
106+
[enabling extension decoders]: https://exoplayer.dev/demo-application.html#enabling-extension-decoders
107+
100108
## Links ##
101109

102110
* [Javadoc][]: Classes matching `com.google.android.exoplayer2.ext.flac.*`

extensions/flac/src/main/jni/flac_parser.cc

+3-2
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,9 @@ bool FLACParser::getSeekPositions(int64_t timeUs,
462462
if (sampleNumber <= targetSampleNumber) {
463463
result[0] = (sampleNumber * 1000000LL) / sampleRate;
464464
result[1] = firstFrameOffset + points[i - 1].stream_offset;
465-
if (sampleNumber == targetSampleNumber || i >= length) {
466-
// exact seek, or no following seek point.
465+
if (sampleNumber == targetSampleNumber || i >= length ||
466+
points[i].sample_number == -1) { // placeholder
467+
// exact seek, or no following non-placeholder seek point
467468
result[2] = result[0];
468469
result[3] = result[1];
469470
} else {

extensions/opus/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ a custom track selector the choice of `Renderer` is up to your implementation,
101101
so you need to make sure you are passing an `LibopusAudioRenderer` to the
102102
player, then implement your own logic to use the renderer for a given track.
103103

104+
## Using the extension in the demo application ##
105+
106+
To try out playback using the extension in the [demo application][], see
107+
[enabling extension decoders][].
108+
109+
[demo application]: https://exoplayer.dev/demo-application.html
110+
[enabling extension decoders]: https://exoplayer.dev/demo-application.html#enabling-extension-decoders
111+
104112
## Links ##
105113

106114
* [Javadoc][]: Classes matching `com.google.android.exoplayer2.ext.opus.*`

extensions/vp9/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,14 @@ a custom track selector the choice of `Renderer` is up to your implementation,
114114
so you need to make sure you are passing an `LibvpxVideoRenderer` to the
115115
player, then implement your own logic to use the renderer for a given track.
116116

117+
## Using the extension in the demo application ##
118+
119+
To try out playback using the extension in the [demo application][], see
120+
[enabling extension decoders][].
121+
122+
[demo application]: https://exoplayer.dev/demo-application.html
123+
[enabling extension decoders]: https://exoplayer.dev/demo-application.html#enabling-extension-decoders
124+
117125
## Rendering options ##
118126

119127
There are two possibilities for rendering the output `LibvpxVideoRenderer`

library/core/proguard-rules.txt

+15-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
11
# Proguard rules specific to the core module.
22

3+
# Constant folding for resource integers may mean that a resource passed to this method appears to be unused. Keep the method to prevent this from happening.
4+
-keep class com.google.android.exoplayer2.upstream.RawResourceDataSource {
5+
public static android.net.Uri buildRawResourceUri(int);
6+
}
7+
8+
# Some members of this class are being accessed from native methods. Keep them unobfuscated.
9+
-keep class com.google.android.exoplayer2.video.VideoDecoderOutputBuffer {
10+
*;
11+
}
12+
313
# Constructors accessed via reflection in DefaultRenderersFactory
414
-dontnote com.google.android.exoplayer2.ext.vp9.LibvpxVideoRenderer
515
-keepclassmembers class com.google.android.exoplayer2.ext.vp9.LibvpxVideoRenderer {
616
<init>(long, android.os.Handler, com.google.android.exoplayer2.video.VideoRendererEventListener, int);
717
}
18+
-dontnote com.google.android.exoplayer2.ext.av1.Libgav1VideoRenderer
19+
-keepclassmembers class com.google.android.exoplayer2.ext.av1.Libgav1VideoRenderer {
20+
<init>(long, android.os.Handler, com.google.android.exoplayer2.video.VideoRendererEventListener, int);
21+
}
822
-dontnote com.google.android.exoplayer2.ext.opus.LibopusAudioRenderer
923
-keepclassmembers class com.google.android.exoplayer2.ext.opus.LibopusAudioRenderer {
1024
<init>(android.os.Handler, com.google.android.exoplayer2.audio.AudioRendererEventListener, com.google.android.exoplayer2.audio.AudioProcessor[]);
@@ -61,8 +75,4 @@
6175
# Don't warn about checkerframework and Kotlin annotations
6276
-dontwarn org.checkerframework.**
6377
-dontwarn kotlin.annotations.jvm.**
64-
65-
# Some members of this class are being accessed from native methods. Keep them unobfuscated.
66-
-keep class com.google.android.exoplayer2.ext.video.VideoDecoderOutputBuffer {
67-
*;
68-
}
78+
-dontwarn javax.annotation.**

library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerLibraryInfo.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ public final class ExoPlayerLibraryInfo {
2929

3030
/** The version of the library expressed as a string, for example "1.2.3". */
3131
// Intentionally hardcoded. Do not derive from other constants (e.g. VERSION_INT) or vice versa.
32-
public static final String VERSION = "2.11.0";
32+
public static final String VERSION = "2.11.1";
3333

3434
/** The version of the library expressed as {@code "ExoPlayerLib/" + VERSION}. */
3535
// Intentionally hardcoded. Do not derive from other constants (e.g. VERSION) or vice versa.
36-
public static final String VERSION_SLASHY = "ExoPlayerLib/2.11.0";
36+
public static final String VERSION_SLASHY = "ExoPlayerLib/2.11.1";
3737

3838
/**
3939
* The version of the library expressed as an integer, for example 1002003.
@@ -43,7 +43,7 @@ public final class ExoPlayerLibraryInfo {
4343
* integer version 123045006 (123-045-006).
4444
*/
4545
// Intentionally hardcoded. Do not derive from other constants (e.g. VERSION) or vice versa.
46-
public static final int VERSION_INT = 2011000;
46+
public static final int VERSION_INT = 2011001;
4747

4848
/**
4949
* Whether the library was compiled with {@link com.google.android.exoplayer2.util.Assertions}

library/core/src/main/java/com/google/android/exoplayer2/analytics/AnalyticsCollector.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -804,9 +804,13 @@ public void onSeekProcessed() {
804804

805805
/** Updates the queue with a newly created media period. */
806806
public void onMediaPeriodCreated(int windowIndex, MediaPeriodId mediaPeriodId) {
807-
boolean isInTimeline = timeline.getIndexOfPeriod(mediaPeriodId.periodUid) != C.INDEX_UNSET;
807+
int periodIndex = timeline.getIndexOfPeriod(mediaPeriodId.periodUid);
808+
boolean isInTimeline = periodIndex != C.INDEX_UNSET;
808809
MediaPeriodInfo mediaPeriodInfo =
809-
new MediaPeriodInfo(mediaPeriodId, isInTimeline ? timeline : Timeline.EMPTY, windowIndex);
810+
new MediaPeriodInfo(
811+
mediaPeriodId,
812+
isInTimeline ? timeline : Timeline.EMPTY,
813+
isInTimeline ? timeline.getPeriod(periodIndex, period).windowIndex : windowIndex);
810814
mediaPeriodInfoQueue.add(mediaPeriodInfo);
811815
mediaPeriodIdToInfo.put(mediaPeriodId, mediaPeriodInfo);
812816
lastPlayingMediaPeriod = mediaPeriodInfoQueue.get(0);

library/core/src/main/java/com/google/android/exoplayer2/audio/MediaCodecAudioRenderer.java

+1
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@ protected boolean canKeepCodecWithFlush(Format oldFormat, Format newFormat) {
520520
}
521521

522522
@Override
523+
@Nullable
523524
public MediaClock getMediaClock() {
524525
return this;
525526
}

library/core/src/main/java/com/google/android/exoplayer2/audio/SimpleDecoderAudioRenderer.java

+1
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ public SimpleDecoderAudioRenderer(
218218
}
219219

220220
@Override
221+
@Nullable
221222
public MediaClock getMediaClock() {
222223
return this;
223224
}

library/core/src/main/java/com/google/android/exoplayer2/extractor/mkv/MatroskaExtractor.java

+10
Original file line numberDiff line numberDiff line change
@@ -1635,6 +1635,16 @@ private SeekMap buildSeekMap() {
16351635
sizes[cuePointsSize - 1] =
16361636
(int) (segmentContentPosition + segmentContentSize - offsets[cuePointsSize - 1]);
16371637
durationsUs[cuePointsSize - 1] = durationUs - timesUs[cuePointsSize - 1];
1638+
1639+
long lastDurationUs = durationsUs[cuePointsSize - 1];
1640+
if (lastDurationUs <= 0) {
1641+
Log.w(TAG, "Discarding last cue point with unexpected duration: " + lastDurationUs);
1642+
sizes = Arrays.copyOf(sizes, sizes.length - 1);
1643+
offsets = Arrays.copyOf(offsets, offsets.length - 1);
1644+
durationsUs = Arrays.copyOf(durationsUs, durationsUs.length - 1);
1645+
timesUs = Arrays.copyOf(timesUs, timesUs.length - 1);
1646+
}
1647+
16381648
cueTimesUs = null;
16391649
cueClusterPositions = null;
16401650
return new ChunkIndex(sizes, offsets, durationsUs, timesUs);

library/core/src/main/java/com/google/android/exoplayer2/extractor/mp4/Sniffer.java

-4
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,6 @@ private static boolean sniffInternal(ExtractorInput input, boolean fragmented)
118118
}
119119
}
120120

121-
if (inputLength != C.LENGTH_UNSET && bytesSearched + atomSize > inputLength) {
122-
// The file is invalid because the atom extends past the end of the file.
123-
return false;
124-
}
125121
if (atomSize < headerSize) {
126122
// The file is invalid because the atom size is too small for its header.
127123
return false;

library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecRenderer.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@
5959
*/
6060
public abstract class MediaCodecRenderer extends BaseRenderer {
6161

62-
/**
63-
* Thrown when a failure occurs instantiating a decoder.
64-
*/
62+
/** Thrown when a failure occurs instantiating a decoder. */
6563
public static class DecoderInitializationException extends Exception {
6664

6765
private static final int CUSTOM_ERROR_CODE_BASE = -50000;

library/core/src/main/java/com/google/android/exoplayer2/offline/DefaultDownloadIndex.java

+15-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
import com.google.android.exoplayer2.database.DatabaseIOException;
2727
import com.google.android.exoplayer2.database.DatabaseProvider;
2828
import com.google.android.exoplayer2.database.VersionTable;
29+
import com.google.android.exoplayer2.offline.Download.FailureReason;
30+
import com.google.android.exoplayer2.offline.Download.State;
2931
import com.google.android.exoplayer2.util.Assertions;
3032
import com.google.android.exoplayer2.util.Util;
3133
import java.util.ArrayList;
@@ -239,6 +241,9 @@ public void setStatesToRemoving() throws DatabaseIOException {
239241
try {
240242
ContentValues values = new ContentValues();
241243
values.put(COLUMN_STATE, Download.STATE_REMOVING);
244+
// Only downloads in STATE_FAILED are allowed a failure reason, so we need to clear it here in
245+
// case we're moving downloads from STATE_FAILED to STATE_REMOVING.
246+
values.put(COLUMN_FAILURE_REASON, Download.FAILURE_REASON_NONE);
242247
SQLiteDatabase writableDatabase = databaseProvider.getWritableDatabase();
243248
writableDatabase.update(tableName, values, /* whereClause= */ null, /* whereArgs= */ null);
244249
} catch (SQLException e) {
@@ -351,14 +356,22 @@ private static Download getDownloadForCurrentRow(Cursor cursor) {
351356
DownloadProgress downloadProgress = new DownloadProgress();
352357
downloadProgress.bytesDownloaded = cursor.getLong(COLUMN_INDEX_BYTES_DOWNLOADED);
353358
downloadProgress.percentDownloaded = cursor.getFloat(COLUMN_INDEX_PERCENT_DOWNLOADED);
359+
@State int state = cursor.getInt(COLUMN_INDEX_STATE);
360+
// It's possible the database contains failure reasons for non-failed downloads, which is
361+
// invalid. Clear them here. See https://github.com/google/ExoPlayer/issues/6785.
362+
@FailureReason
363+
int failureReason =
364+
state == Download.STATE_FAILED
365+
? cursor.getInt(COLUMN_INDEX_FAILURE_REASON)
366+
: Download.FAILURE_REASON_NONE;
354367
return new Download(
355368
request,
356-
/* state= */ cursor.getInt(COLUMN_INDEX_STATE),
369+
state,
357370
/* startTimeMs= */ cursor.getLong(COLUMN_INDEX_START_TIME_MS),
358371
/* updateTimeMs= */ cursor.getLong(COLUMN_INDEX_UPDATE_TIME_MS),
359372
/* contentLength= */ cursor.getLong(COLUMN_INDEX_CONTENT_LENGTH),
360373
/* stopReason= */ cursor.getInt(COLUMN_INDEX_STOP_REASON),
361-
/* failureReason= */ cursor.getInt(COLUMN_INDEX_FAILURE_REASON),
374+
failureReason,
362375
downloadProgress);
363376
}
364377

library/core/src/main/java/com/google/android/exoplayer2/offline/Download.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ public Download(
130130
@FailureReason int failureReason,
131131
DownloadProgress progress) {
132132
Assertions.checkNotNull(progress);
133-
Assertions.checkState((failureReason == FAILURE_REASON_NONE) == (state != STATE_FAILED));
133+
Assertions.checkArgument((failureReason == FAILURE_REASON_NONE) == (state != STATE_FAILED));
134134
if (stopReason != 0) {
135-
Assertions.checkState(state != STATE_DOWNLOADING && state != STATE_QUEUED);
135+
Assertions.checkArgument(state != STATE_DOWNLOADING && state != STATE_QUEUED);
136136
}
137137
this.request = request;
138138
this.state = state;

0 commit comments

Comments
 (0)