Formatting fixes

This commit is contained in:
tonihei 2024-12-18 12:54:27 +00:00
parent 6287a22285
commit 1c044c98ad

View File

@ -29,6 +29,7 @@ import androidx.media3.extractor.DefaultExtractorInput;
import androidx.media3.extractor.Extractor; import androidx.media3.extractor.Extractor;
import androidx.media3.extractor.ExtractorInput; import androidx.media3.extractor.ExtractorInput;
import androidx.media3.extractor.TrackOutput; import androidx.media3.extractor.TrackOutput;
import com.google.errorprone.annotations.ForOverride;
import java.io.IOException; import java.io.IOException;
/** A {@link BaseMediaChunk} that uses an {@link Extractor} to decode sample data. */ /** A {@link BaseMediaChunk} that uses an {@link Extractor} to decode sample data. */
@ -135,7 +136,7 @@ public class ContainerMediaChunk extends BaseMediaChunk {
nextLoadPosition = input.getPosition() - dataSpec.position; nextLoadPosition = input.getPosition() - dataSpec.position;
} }
} finally { } finally {
onLoadIterationEnded(); onLoadEnded();
DataSourceUtil.closeQuietly(dataSource); DataSourceUtil.closeQuietly(dataSource);
} }
loadCompleted = !loadCanceled; loadCompleted = !loadCanceled;
@ -154,24 +155,17 @@ public class ContainerMediaChunk extends BaseMediaChunk {
/** /**
* Method that is called to signal that a {@link #load()} has concluded. This is called in both * Method that is called to signal that a {@link #load()} has concluded. This is called in both
* successful and error scenarios. * successful and error scenarios before the {@link DataSource} is closed.
*/ */
protected void onLoadIterationEnded() {} @ForOverride
protected void onLoadEnded() {}
/** /** Returns whether the current chunk's load has been canceled from {@link #cancelLoad()}. */
* Returns whether the current chunk's load has been canceled from {@link #cancelLoad()}
*
* @return true if {@link #cancelLoad()} was invoked
*/
public final boolean isLoadCanceled() { public final boolean isLoadCanceled() {
return loadCanceled; return loadCanceled;
} }
/** /** Returns the next position to load in the chunk on a {@link #load()}. */
* Retrieves the next position to load in the chunk on a {@link #load()}
*
* @return the position to load from
*/
public final long getNextLoadPosition() { public final long getNextLoadPosition() {
return nextLoadPosition; return nextLoadPosition;
} }