Commit aa570621 by Oliver Woodman

Restore equivalence

parent 51405c99
...@@ -38,8 +38,8 @@ repositories { ...@@ -38,8 +38,8 @@ repositories {
} }
``` ```
Next add a gradle compile dependency to the `build.gradle` file of your app Next add a dependency in the `build.gradle` file of your app module. The
module. The following will add a dependency to the full library: following will add a dependency to the full library:
```gradle ```gradle
implementation 'com.google.android.exoplayer:exoplayer:2.X.X' implementation 'com.google.android.exoplayer:exoplayer:2.X.X'
......
...@@ -1929,12 +1929,12 @@ public final class MatroskaExtractor implements Extractor { ...@@ -1929,12 +1929,12 @@ public final class MatroskaExtractor implements Extractor {
/** /**
* Builds initialization data for a {@link Format} from FourCC codec private data. * Builds initialization data for a {@link Format} from FourCC codec private data.
* <p>
* VC1 and H263 are the only supported compression types.
* *
* @return A pair object with the first object being the codec mime type * <p>VC1 and H263 are the only supported compression types.
* and the second object the initialization data for the {@link Format}, *
* or null if the compression type is not a currently supported type (VC1 or H263). * @return The codec mime type and initialization data. If the compression type is not supported
* then the mime type is set to {@link MimeTypes#VIDEO_UNKNOWN} and the initialization data
* is {@code null}.
* @throws ParserException If the initialization data could not be built. * @throws ParserException If the initialization data could not be built.
*/ */
private static Pair<String, List<byte[]>> parseFourCcPrivate(ParsableByteArray buffer) private static Pair<String, List<byte[]>> parseFourCcPrivate(ParsableByteArray buffer)
...@@ -1944,14 +1944,16 @@ public final class MatroskaExtractor implements Extractor { ...@@ -1944,14 +1944,16 @@ public final class MatroskaExtractor implements Extractor {
long compression = buffer.readLittleEndianUnsignedInt(); long compression = buffer.readLittleEndianUnsignedInt();
if (compression == FOURCC_COMPRESSION_DIVX) { if (compression == FOURCC_COMPRESSION_DIVX) {
return new Pair<>(MimeTypes.VIDEO_H263, null); return new Pair<>(MimeTypes.VIDEO_H263, null);
} else if (compression == FOURCC_COMPRESSION_VC1) { } else if (compression == FOURCC_COMPRESSION_VC1) {
// Search for the initialization data from the end of the BITMAPINFOHEADER. The last 20 // Search for the initialization data from the end of the BITMAPINFOHEADER. The last 20
// bytes of which are: sizeImage(4), xPel/m (4), yPel/m (4), clrUsed(4), clrImportant(4). // bytes of which are: sizeImage(4), xPel/m (4), yPel/m (4), clrUsed(4), clrImportant(4).
int startOffset = buffer.getPosition() + 20; int startOffset = buffer.getPosition() + 20;
byte[] bufferData = buffer.data; byte[] bufferData = buffer.data;
for (int offset = startOffset; offset < bufferData.length - 4; offset++) { for (int offset = startOffset; offset < bufferData.length - 4; offset++) {
if (bufferData[offset] == 0x00 && bufferData[offset + 1] == 0x00 if (bufferData[offset] == 0x00
&& bufferData[offset + 2] == 0x01 && bufferData[offset + 3] == 0x0F) { && bufferData[offset + 1] == 0x00
&& bufferData[offset + 2] == 0x01
&& bufferData[offset + 3] == 0x0F) {
// We've found the initialization data. // We've found the initialization data.
byte[] initializationData = Arrays.copyOfRange(bufferData, offset, bufferData.length); byte[] initializationData = Arrays.copyOfRange(bufferData, offset, bufferData.length);
return new Pair<>(MimeTypes.VIDEO_VC1, Collections.singletonList(initializationData)); return new Pair<>(MimeTypes.VIDEO_VC1, Collections.singletonList(initializationData));
......
...@@ -289,6 +289,7 @@ public abstract class DownloadService extends Service implements DownloadManager ...@@ -289,6 +289,7 @@ public abstract class DownloadService extends Service implements DownloadManager
@Override @Override
public void onIdle(DownloadManager downloadManager) { public void onIdle(DownloadManager downloadManager) {
// Make sure startForeground is called before stopping. // Make sure startForeground is called before stopping.
// Workaround for https://buganizer.corp.google.com/issues/69424260
if (Util.SDK_INT >= 26) { if (Util.SDK_INT >= 26) {
Builder notificationBuilder = new Builder(this, getNotificationChannelId()); Builder notificationBuilder = new Builder(this, getNotificationChannelId());
Notification foregroundNotification = notificationBuilder.build(); Notification foregroundNotification = notificationBuilder.build();
......
...@@ -614,8 +614,8 @@ public class DefaultHttpDataSource implements HttpDataSource { ...@@ -614,8 +614,8 @@ public class DefaultHttpDataSource implements HttpDataSource {
} }
String className = inputStream.getClass().getName(); String className = inputStream.getClass().getName();
if ("com.android.okhttp.internal.http.HttpTransport$ChunkedInputStream".equals(className) if ("com.android.okhttp.internal.http.HttpTransport$ChunkedInputStream".equals(className)
|| "com.android.okhttp.internal.http.HttpTransport$FixedLengthInputStream".equals( || "com.android.okhttp.internal.http.HttpTransport$FixedLengthInputStream"
className)) { .equals(className)) {
Class<?> superclass = inputStream.getClass().getSuperclass(); Class<?> superclass = inputStream.getClass().getSuperclass();
Method unexpectedEndOfInput = superclass.getDeclaredMethod("unexpectedEndOfInput"); Method unexpectedEndOfInput = superclass.getDeclaredMethod("unexpectedEndOfInput");
unexpectedEndOfInput.setAccessible(true); unexpectedEndOfInput.setAccessible(true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment