From 8f2103d6fc79a791ce0621c01ac620eba39bbccb Mon Sep 17 00:00:00 2001 From: preilly Date: Fri, 23 Oct 2015 13:17:33 -0400 Subject: [PATCH] Modified updateDurationUs() to also filter out TrackRenderers with a state of STATE_IGNORE. --- build.gradle~ | 33 -------- library/build.gradle~ | 80 ------------------- .../exoplayer/ExoPlayerImplInternal.java | 5 +- 3 files changed, 4 insertions(+), 114 deletions(-) delete mode 100644 build.gradle~ delete mode 100644 library/build.gradle~ diff --git a/build.gradle~ b/build.gradle~ deleted file mode 100644 index 076159b5a78..00000000000 --- a/build.gradle~ +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (C) 2014 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - mavenCentral() - jcenter() - } - dependencies { - classpath 'com.github.dcendents:android-maven-plugin:1.2' - classpath 'com.android.tools.build:gradle:1.0.0' - classpath 'com.novoda:bintray-release:0.2.7' - } -} - -allprojects { - repositories { - mavenCentral() - } -} diff --git a/library/build.gradle~ b/library/build.gradle~ deleted file mode 100644 index 0e4974e372e..00000000000 --- a/library/build.gradle~ +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (C) 2014 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -apply plugin: 'com.android.library' -<<<<<<< HEAD -apply plugin: 'com.github.dcendents.android-maven' - -configurations { - deployerJars -} -======= -apply plugin: 'bintray-release' ->>>>>>> df9e552e9dc1a6585640ad4d10fff7fc4b05d1ab - -android { - compileSdkVersion 21 - buildToolsVersion "21.1.2" - - defaultConfig { - minSdkVersion 9 - targetSdkVersion 21 - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' - } - } - - lintOptions { - abortOnError false - } -} - -dependencies { - deployerJars "org.kuali.maven.wagons:maven-s3-wagon:1.2.1" -} - -uploadArchives { - repositories.mavenDeployer { - configuration = configurations.deployerJars - repository(url: 's3://repo.brightcove.com/releases') { - } - snapshotRepository(url: 's3://repo.brightcove.com/snapshots') { - } - } -} -uploadArchives.dependsOn 'install' - -android.libraryVariants.all { variant -> - def name = variant.buildType.name - if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) { - return; // Skip debug builds. - } - def task = project.tasks.create "jar${name.capitalize()}", Jar - task.dependsOn variant.javaCompile - task.from variant.javaCompile.destinationDir - artifacts.add('archives', task); -} - -publish { - repoName = 'exoplayer' - userOrg = 'google' - groupId = 'com.google.android.exoplayer' - artifactId = 'exoplayer' - version = 'r1.2.4' - description = 'The ExoPlayer library.' - website = 'https://github.com/google/ExoPlayer' -} diff --git a/library/src/main/java/com/google/android/exoplayer/ExoPlayerImplInternal.java b/library/src/main/java/com/google/android/exoplayer/ExoPlayerImplInternal.java index d51a8e34a47..c372d880ec9 100644 --- a/library/src/main/java/com/google/android/exoplayer/ExoPlayerImplInternal.java +++ b/library/src/main/java/com/google/android/exoplayer/ExoPlayerImplInternal.java @@ -337,7 +337,10 @@ private void updateDurationUs() { long durationUs = 0; for (int i = 0; i < renderers.length; i++) { TrackRenderer renderer = renderers[i]; - if (rendererEnabledFlags[i] && renderer.getState() != TrackRenderer.STATE_UNPREPARED && renderer.getState() != TrackRenderer.STATE_RELEASED ) { + if (rendererEnabledFlags[i] + && renderer.getState() != TrackRenderer.STATE_IGNORE + && renderer.getState() != TrackRenderer.STATE_UNPREPARED + && renderer.getState() != TrackRenderer.STATE_RELEASED ) { if (durationUs == TrackRenderer.UNKNOWN_TIME_US) { // We've already encountered a track for which the duration is unknown, so the media // duration is unknown regardless of the duration of this track.