mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Make ExtractorSampleSource constructor consistent.
The allocator and buffering policy (e.g. how large the buffer is) is moving to the top level as part of playlist support, so it no longer makes sense to inject these parameters as args into ExtractorSampleSource's constructor. Instantiating the allocator and buffer size inside of the source is temporary and only until they're moved up. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=123968976
This commit is contained in:
parent
6fd610fc5f
commit
ff745ac444
5 changed files with 38 additions and 105 deletions
|
|
@ -15,7 +15,6 @@
|
||||||
*/
|
*/
|
||||||
package com.google.android.exoplayer.demo;
|
package com.google.android.exoplayer.demo;
|
||||||
|
|
||||||
import com.google.android.exoplayer.C;
|
|
||||||
import com.google.android.exoplayer.SampleSource;
|
import com.google.android.exoplayer.SampleSource;
|
||||||
import com.google.android.exoplayer.SampleSourceProvider;
|
import com.google.android.exoplayer.SampleSourceProvider;
|
||||||
import com.google.android.exoplayer.SimpleExoPlayer;
|
import com.google.android.exoplayer.SimpleExoPlayer;
|
||||||
|
|
@ -23,10 +22,7 @@ import com.google.android.exoplayer.dash.DashSampleSource;
|
||||||
import com.google.android.exoplayer.extractor.ExtractorSampleSource;
|
import com.google.android.exoplayer.extractor.ExtractorSampleSource;
|
||||||
import com.google.android.exoplayer.hls.HlsSampleSource;
|
import com.google.android.exoplayer.hls.HlsSampleSource;
|
||||||
import com.google.android.exoplayer.smoothstreaming.SmoothStreamingSampleSource;
|
import com.google.android.exoplayer.smoothstreaming.SmoothStreamingSampleSource;
|
||||||
import com.google.android.exoplayer.upstream.Allocator;
|
|
||||||
import com.google.android.exoplayer.upstream.DataSource;
|
|
||||||
import com.google.android.exoplayer.upstream.DataSourceFactory;
|
import com.google.android.exoplayer.upstream.DataSourceFactory;
|
||||||
import com.google.android.exoplayer.upstream.DefaultAllocator;
|
|
||||||
import com.google.android.exoplayer.util.Util;
|
import com.google.android.exoplayer.util.Util;
|
||||||
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
|
@ -116,10 +112,8 @@ public final class UriSampleSourceProvider implements SampleSourceProvider {
|
||||||
return new HlsSampleSource(uri, dataSourceFactory, player.getBandwidthMeter(), handler,
|
return new HlsSampleSource(uri, dataSourceFactory, player.getBandwidthMeter(), handler,
|
||||||
eventLogger);
|
eventLogger);
|
||||||
case Util.TYPE_OTHER:
|
case Util.TYPE_OTHER:
|
||||||
Allocator allocator = new DefaultAllocator(C.DEFAULT_BUFFER_SEGMENT_SIZE);
|
return new ExtractorSampleSource(uri, dataSourceFactory, player.getBandwidthMeter(),
|
||||||
DataSource dataSource = dataSourceFactory.createDataSource(player.getBandwidthMeter());
|
ExtractorSampleSource.newDefaultExtractors(), handler, eventLogger, 0);
|
||||||
return new ExtractorSampleSource(uri, dataSource, allocator, C.DEFAULT_MUXED_BUFFER_SIZE,
|
|
||||||
handler, eventLogger, 0, ExtractorSampleSource.newDefaultExtractors());
|
|
||||||
default:
|
default:
|
||||||
throw new IllegalStateException("Unsupported type: " + type);
|
throw new IllegalStateException("Unsupported type: " + type);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,7 @@ import com.google.android.exoplayer.TrackRenderer;
|
||||||
import com.google.android.exoplayer.extractor.Extractor;
|
import com.google.android.exoplayer.extractor.Extractor;
|
||||||
import com.google.android.exoplayer.extractor.ExtractorSampleSource;
|
import com.google.android.exoplayer.extractor.ExtractorSampleSource;
|
||||||
import com.google.android.exoplayer.extractor.mkv.MatroskaExtractor;
|
import com.google.android.exoplayer.extractor.mkv.MatroskaExtractor;
|
||||||
import com.google.android.exoplayer.upstream.DefaultAllocator;
|
import com.google.android.exoplayer.upstream.DefaultDataSourceFactory;
|
||||||
import com.google.android.exoplayer.upstream.DefaultDataSource;
|
|
||||||
import com.google.android.exoplayer.util.Util;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
|
@ -60,9 +58,6 @@ public class FlacPlaybackTest extends InstrumentationTestCase {
|
||||||
|
|
||||||
private static class TestPlaybackThread extends Thread implements ExoPlayer.EventListener {
|
private static class TestPlaybackThread extends Thread implements ExoPlayer.EventListener {
|
||||||
|
|
||||||
private static final int BUFFER_SEGMENT_SIZE = 64 * 1024;
|
|
||||||
private static final int BUFFER_SEGMENT_COUNT = 16;
|
|
||||||
|
|
||||||
private final Context context;
|
private final Context context;
|
||||||
private final Uri uri;
|
private final Uri uri;
|
||||||
|
|
||||||
|
|
@ -84,10 +79,9 @@ public class FlacPlaybackTest extends InstrumentationTestCase {
|
||||||
player.addListener(this);
|
player.addListener(this);
|
||||||
ExtractorSampleSource sampleSource = new ExtractorSampleSource(
|
ExtractorSampleSource sampleSource = new ExtractorSampleSource(
|
||||||
uri,
|
uri,
|
||||||
new DefaultDataSource(context, null, Util.getUserAgent(context, "ExoPlayerExtFlacTest"),
|
new DefaultDataSourceFactory(context, "ExoPlayerExtFlacTest"), null,
|
||||||
false),
|
new Extractor[] {new MatroskaExtractor()},
|
||||||
new DefaultAllocator(BUFFER_SEGMENT_SIZE), BUFFER_SEGMENT_SIZE * BUFFER_SEGMENT_COUNT,
|
null, null, 0);
|
||||||
new Extractor[] {new MatroskaExtractor()});
|
|
||||||
player.setSource(sampleSource);
|
player.setSource(sampleSource);
|
||||||
player.setPlayWhenReady(true);
|
player.setPlayWhenReady(true);
|
||||||
Looper.loop();
|
Looper.loop();
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,7 @@ import com.google.android.exoplayer.TrackRenderer;
|
||||||
import com.google.android.exoplayer.extractor.Extractor;
|
import com.google.android.exoplayer.extractor.Extractor;
|
||||||
import com.google.android.exoplayer.extractor.ExtractorSampleSource;
|
import com.google.android.exoplayer.extractor.ExtractorSampleSource;
|
||||||
import com.google.android.exoplayer.extractor.mkv.MatroskaExtractor;
|
import com.google.android.exoplayer.extractor.mkv.MatroskaExtractor;
|
||||||
import com.google.android.exoplayer.upstream.DefaultAllocator;
|
import com.google.android.exoplayer.upstream.DefaultDataSourceFactory;
|
||||||
import com.google.android.exoplayer.upstream.DefaultDataSource;
|
|
||||||
import com.google.android.exoplayer.util.Util;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
|
@ -60,9 +58,6 @@ public class OpusPlaybackTest extends InstrumentationTestCase {
|
||||||
|
|
||||||
private static class TestPlaybackThread extends Thread implements ExoPlayer.EventListener {
|
private static class TestPlaybackThread extends Thread implements ExoPlayer.EventListener {
|
||||||
|
|
||||||
private static final int BUFFER_SEGMENT_SIZE = 64 * 1024;
|
|
||||||
private static final int BUFFER_SEGMENT_COUNT = 16;
|
|
||||||
|
|
||||||
private final Context context;
|
private final Context context;
|
||||||
private final Uri uri;
|
private final Uri uri;
|
||||||
|
|
||||||
|
|
@ -84,10 +79,9 @@ public class OpusPlaybackTest extends InstrumentationTestCase {
|
||||||
player.addListener(this);
|
player.addListener(this);
|
||||||
ExtractorSampleSource sampleSource = new ExtractorSampleSource(
|
ExtractorSampleSource sampleSource = new ExtractorSampleSource(
|
||||||
uri,
|
uri,
|
||||||
new DefaultDataSource(context, null, Util.getUserAgent(context, "ExoPlayerExtOpusTest"),
|
new DefaultDataSourceFactory(context, "ExoPlayerExtOpusTest"), null,
|
||||||
false),
|
new Extractor[] {new MatroskaExtractor()},
|
||||||
new DefaultAllocator(BUFFER_SEGMENT_SIZE), BUFFER_SEGMENT_SIZE * BUFFER_SEGMENT_COUNT,
|
null, null, 0);
|
||||||
new Extractor[] {new MatroskaExtractor()});
|
|
||||||
player.setSource(sampleSource);
|
player.setSource(sampleSource);
|
||||||
player.setPlayWhenReady(true);
|
player.setPlayWhenReady(true);
|
||||||
Looper.loop();
|
Looper.loop();
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,7 @@ import com.google.android.exoplayer.TrackRenderer;
|
||||||
import com.google.android.exoplayer.extractor.Extractor;
|
import com.google.android.exoplayer.extractor.Extractor;
|
||||||
import com.google.android.exoplayer.extractor.ExtractorSampleSource;
|
import com.google.android.exoplayer.extractor.ExtractorSampleSource;
|
||||||
import com.google.android.exoplayer.extractor.mkv.MatroskaExtractor;
|
import com.google.android.exoplayer.extractor.mkv.MatroskaExtractor;
|
||||||
import com.google.android.exoplayer.upstream.DefaultAllocator;
|
import com.google.android.exoplayer.upstream.DefaultDataSourceFactory;
|
||||||
import com.google.android.exoplayer.upstream.DefaultDataSource;
|
|
||||||
import com.google.android.exoplayer.util.Util;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
|
@ -76,9 +74,6 @@ public class VpxPlaybackTest extends InstrumentationTestCase {
|
||||||
|
|
||||||
private static class TestPlaybackThread extends Thread implements ExoPlayer.EventListener {
|
private static class TestPlaybackThread extends Thread implements ExoPlayer.EventListener {
|
||||||
|
|
||||||
private static final int BUFFER_SEGMENT_SIZE = 64 * 1024;
|
|
||||||
private static final int BUFFER_SEGMENT_COUNT = 16;
|
|
||||||
|
|
||||||
private final Context context;
|
private final Context context;
|
||||||
private final Uri uri;
|
private final Uri uri;
|
||||||
|
|
||||||
|
|
@ -100,10 +95,9 @@ public class VpxPlaybackTest extends InstrumentationTestCase {
|
||||||
player.addListener(this);
|
player.addListener(this);
|
||||||
ExtractorSampleSource sampleSource = new ExtractorSampleSource(
|
ExtractorSampleSource sampleSource = new ExtractorSampleSource(
|
||||||
uri,
|
uri,
|
||||||
new DefaultDataSource(context, null, Util.getUserAgent(context, "ExoPlayerExtVP9Test"),
|
new DefaultDataSourceFactory(context, "ExoPlayerExtVp9Test"), null,
|
||||||
false),
|
new Extractor[] {new MatroskaExtractor()},
|
||||||
new DefaultAllocator(BUFFER_SEGMENT_SIZE), BUFFER_SEGMENT_SIZE * BUFFER_SEGMENT_COUNT,
|
null, null, 0);
|
||||||
new Extractor[] {new MatroskaExtractor()});
|
|
||||||
player.sendMessages(new ExoPlayer.ExoPlayerMessage(videoRenderer,
|
player.sendMessages(new ExoPlayer.ExoPlayerMessage(videoRenderer,
|
||||||
LibvpxVideoTrackRenderer.MSG_SET_OUTPUT_BUFFER_RENDERER,
|
LibvpxVideoTrackRenderer.MSG_SET_OUTPUT_BUFFER_RENDERER,
|
||||||
new VpxVideoSurfaceView(context)));
|
new VpxVideoSurfaceView(context)));
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,11 @@ import com.google.android.exoplayer.TrackGroupArray;
|
||||||
import com.google.android.exoplayer.TrackSelection;
|
import com.google.android.exoplayer.TrackSelection;
|
||||||
import com.google.android.exoplayer.TrackStream;
|
import com.google.android.exoplayer.TrackStream;
|
||||||
import com.google.android.exoplayer.upstream.Allocator;
|
import com.google.android.exoplayer.upstream.Allocator;
|
||||||
|
import com.google.android.exoplayer.upstream.BandwidthMeter;
|
||||||
import com.google.android.exoplayer.upstream.DataSource;
|
import com.google.android.exoplayer.upstream.DataSource;
|
||||||
|
import com.google.android.exoplayer.upstream.DataSourceFactory;
|
||||||
import com.google.android.exoplayer.upstream.DataSpec;
|
import com.google.android.exoplayer.upstream.DataSpec;
|
||||||
|
import com.google.android.exoplayer.upstream.DefaultAllocator;
|
||||||
import com.google.android.exoplayer.upstream.Loader;
|
import com.google.android.exoplayer.upstream.Loader;
|
||||||
import com.google.android.exoplayer.upstream.Loader.Loadable;
|
import com.google.android.exoplayer.upstream.Loader.Loadable;
|
||||||
import com.google.android.exoplayer.util.Assertions;
|
import com.google.android.exoplayer.util.Assertions;
|
||||||
|
|
@ -112,16 +115,15 @@ public final class ExtractorSampleSource implements SampleSource, ExtractorOutpu
|
||||||
// Lazily initialized default extractor classes in priority order.
|
// Lazily initialized default extractor classes in priority order.
|
||||||
private static List<Class<? extends Extractor>> defaultExtractorClasses;
|
private static List<Class<? extends Extractor>> defaultExtractorClasses;
|
||||||
|
|
||||||
private final Loader loader;
|
|
||||||
private final ExtractorHolder extractorHolder;
|
|
||||||
private final Allocator allocator;
|
|
||||||
private final int requestedBufferSize;
|
|
||||||
private final int minLoadableRetryCount;
|
|
||||||
private final Uri uri;
|
private final Uri uri;
|
||||||
private final DataSource dataSource;
|
private final int minLoadableRetryCount;
|
||||||
private final Handler eventHandler;
|
private final Handler eventHandler;
|
||||||
private final EventListener eventListener;
|
private final EventListener eventListener;
|
||||||
private final int eventSourceId;
|
private final int eventSourceId;
|
||||||
|
private final DataSource dataSource;
|
||||||
|
private final Allocator allocator;
|
||||||
|
private final Loader loader;
|
||||||
|
private final ExtractorHolder extractorHolder;
|
||||||
|
|
||||||
private volatile boolean tracksBuilt;
|
private volatile boolean tracksBuilt;
|
||||||
private volatile SeekMap seekMap;
|
private volatile SeekMap seekMap;
|
||||||
|
|
@ -144,91 +146,46 @@ public final class ExtractorSampleSource implements SampleSource, ExtractorOutpu
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param uri The {@link Uri} of the media stream.
|
* @param uri The {@link Uri} of the media stream.
|
||||||
* @param dataSource A data source to read the media stream.
|
* @param dataSourceFactory A factory for {@link DataSource}s to read the media.
|
||||||
* @param allocator An {@link Allocator} from which to obtain memory allocations.
|
* @param bandwidthMeter A {@link BandwidthMeter} to notify of loads performed by the source.
|
||||||
* @param requestedBufferSize The requested total buffer size for storing sample data, in bytes.
|
|
||||||
* The actual allocated size may exceed the value passed in if the implementation requires it.
|
|
||||||
* @param extractors {@link Extractor}s to process the media stream. Where the possible formats
|
* @param extractors {@link Extractor}s to process the media stream. Where the possible formats
|
||||||
* are known, instantiate and inject only instances of the corresponding {@link Extractor}s.
|
* are known, instantiate and inject only instances of the corresponding {@link Extractor}s.
|
||||||
* Where this is not possible, {@link #newDefaultExtractors()} can be used to construct an
|
* Where this is not possible, {@link #newDefaultExtractors()} can be used to construct an
|
||||||
* array of default extractors.
|
* array of default extractors.
|
||||||
*/
|
|
||||||
public ExtractorSampleSource(Uri uri, DataSource dataSource, Allocator allocator,
|
|
||||||
int requestedBufferSize, Extractor[] extractors) {
|
|
||||||
this(uri, dataSource, allocator, requestedBufferSize, MIN_RETRY_COUNT_DEFAULT_FOR_MEDIA,
|
|
||||||
extractors);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param uri The {@link Uri} of the media stream.
|
|
||||||
* @param dataSource A data source to read the media stream.
|
|
||||||
* @param allocator An {@link Allocator} from which to obtain memory allocations.
|
|
||||||
* @param requestedBufferSize The requested total buffer size for storing sample data, in bytes.
|
|
||||||
* The actual allocated size may exceed the value passed in if the implementation requires it.
|
|
||||||
* @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
|
|
||||||
* null if delivery of events is not required.
|
|
||||||
* @param eventListener A listener of events. May be null if delivery of events is not required.
|
* @param eventListener A listener of events. May be null if delivery of events is not required.
|
||||||
* @param eventSourceId An identifier that gets passed to {@code eventListener} methods.
|
* @param eventSourceId An identifier that gets passed to {@code eventListener} methods.
|
||||||
* @param extractors {@link Extractor}s to process the media stream. Where the possible formats
|
|
||||||
* are known, instantiate and inject only instances of the corresponding {@link Extractor}s.
|
|
||||||
* Where this is not possible, {@link #newDefaultExtractors()} can be used to construct an
|
|
||||||
* array of default extractors.
|
|
||||||
*/
|
*/
|
||||||
public ExtractorSampleSource(Uri uri, DataSource dataSource, Allocator allocator,
|
public ExtractorSampleSource(Uri uri, DataSourceFactory dataSourceFactory,
|
||||||
int requestedBufferSize, Handler eventHandler, EventListener eventListener,
|
BandwidthMeter bandwidthMeter, Extractor[] extractors, Handler eventHandler,
|
||||||
int eventSourceId, Extractor[] extractors) {
|
EventListener eventListener, int eventSourceId) {
|
||||||
this(uri, dataSource, allocator, requestedBufferSize, MIN_RETRY_COUNT_DEFAULT_FOR_MEDIA,
|
this(uri, dataSourceFactory, bandwidthMeter, extractors, MIN_RETRY_COUNT_DEFAULT_FOR_MEDIA,
|
||||||
eventHandler, eventListener, eventSourceId, extractors);
|
eventHandler, eventListener, eventSourceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param uri The {@link Uri} of the media stream.
|
* @param uri The {@link Uri} of the media stream.
|
||||||
* @param dataSource A data source to read the media stream.
|
* @param dataSourceFactory A factory for {@link DataSource}s to read the media.
|
||||||
* @param allocator An {@link Allocator} from which to obtain memory allocations.
|
* @param bandwidthMeter A {@link BandwidthMeter} to notify of loads performed by the source.
|
||||||
* @param requestedBufferSize The requested total buffer size for storing sample data, in bytes.
|
|
||||||
* The actual allocated size may exceed the value passed in if the implementation requires it.
|
|
||||||
* @param minLoadableRetryCount The minimum number of times that the sample source will retry
|
|
||||||
* if a loading error occurs.
|
|
||||||
* @param extractors {@link Extractor}s to process the media stream. Where the possible formats
|
* @param extractors {@link Extractor}s to process the media stream. Where the possible formats
|
||||||
* are known, instantiate and inject only instances of the corresponding {@link Extractor}s.
|
* are known, instantiate and inject only instances of the corresponding {@link Extractor}s.
|
||||||
* Where this is not possible, {@link #newDefaultExtractors()} can be used to construct an
|
* Where this is not possible, {@link #newDefaultExtractors()} can be used to construct an
|
||||||
* array of default extractors.
|
* array of default extractors.
|
||||||
*/
|
|
||||||
public ExtractorSampleSource(Uri uri, DataSource dataSource, Allocator allocator,
|
|
||||||
int requestedBufferSize, int minLoadableRetryCount, Extractor[] extractors) {
|
|
||||||
this(uri, dataSource, allocator, requestedBufferSize, minLoadableRetryCount, null, null, 0,
|
|
||||||
extractors);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param uri The {@link Uri} of the media stream.
|
|
||||||
* @param dataSource A data source to read the media stream.
|
|
||||||
* @param allocator An {@link Allocator} from which to obtain memory allocations.
|
|
||||||
* @param requestedBufferSize The requested total buffer size for storing sample data, in bytes.
|
|
||||||
* The actual allocated size may exceed the value passed in if the implementation requires it.
|
|
||||||
* @param minLoadableRetryCount The minimum number of times that the sample source will retry
|
* @param minLoadableRetryCount The minimum number of times that the sample source will retry
|
||||||
* if a loading error occurs.
|
* if a loading error occurs.
|
||||||
* @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
|
|
||||||
* null if delivery of events is not required.
|
|
||||||
* @param eventListener A listener of events. May be null if delivery of events is not required.
|
* @param eventListener A listener of events. May be null if delivery of events is not required.
|
||||||
* @param eventSourceId An identifier that gets passed to {@code eventListener} methods.
|
* @param eventSourceId An identifier that gets passed to {@code eventListener} methods.
|
||||||
* @param extractors {@link Extractor}s to process the media stream. Where the possible formats
|
|
||||||
* are known, instantiate and inject only instances of the corresponding {@link Extractor}s.
|
|
||||||
* Where this is not possible {@link #newDefaultExtractors()} can be used to construct an
|
|
||||||
* array of default extractors.
|
|
||||||
*/
|
*/
|
||||||
public ExtractorSampleSource(Uri uri, DataSource dataSource, Allocator allocator,
|
public ExtractorSampleSource(Uri uri, DataSourceFactory dataSourceFactory,
|
||||||
int requestedBufferSize, int minLoadableRetryCount, Handler eventHandler,
|
BandwidthMeter bandwidthMeter, Extractor[] extractors, int minLoadableRetryCount,
|
||||||
EventListener eventListener, int eventSourceId, Extractor[] extractors) {
|
Handler eventHandler, EventListener eventListener, int eventSourceId) {
|
||||||
Assertions.checkState(extractors != null && extractors.length > 0);
|
Assertions.checkState(extractors != null && extractors.length > 0);
|
||||||
this.uri = uri;
|
this.uri = uri;
|
||||||
this.dataSource = dataSource;
|
this.minLoadableRetryCount = minLoadableRetryCount;
|
||||||
this.eventListener = eventListener;
|
this.eventListener = eventListener;
|
||||||
this.eventHandler = eventHandler;
|
this.eventHandler = eventHandler;
|
||||||
this.eventSourceId = eventSourceId;
|
this.eventSourceId = eventSourceId;
|
||||||
this.allocator = allocator;
|
dataSource = dataSourceFactory.createDataSource(bandwidthMeter);
|
||||||
this.requestedBufferSize = requestedBufferSize;
|
allocator = new DefaultAllocator(C.DEFAULT_BUFFER_SEGMENT_SIZE);
|
||||||
this.minLoadableRetryCount = minLoadableRetryCount;
|
|
||||||
loader = new Loader("Loader:ExtractorSampleSource");
|
loader = new Loader("Loader:ExtractorSampleSource");
|
||||||
extractorHolder = new ExtractorHolder(extractors, this);
|
extractorHolder = new ExtractorHolder(extractors, this);
|
||||||
pendingResetPositionUs = C.UNSET_TIME_US;
|
pendingResetPositionUs = C.UNSET_TIME_US;
|
||||||
|
|
@ -573,7 +530,7 @@ public final class ExtractorSampleSource implements SampleSource, ExtractorOutpu
|
||||||
|
|
||||||
private void startLoading() {
|
private void startLoading() {
|
||||||
ExtractingLoadable loadable = new ExtractingLoadable(uri, dataSource, extractorHolder,
|
ExtractingLoadable loadable = new ExtractingLoadable(uri, dataSource, extractorHolder,
|
||||||
allocator, requestedBufferSize);
|
allocator, C.DEFAULT_MUXED_BUFFER_SIZE);
|
||||||
if (prepared) {
|
if (prepared) {
|
||||||
Assertions.checkState(isPendingReset());
|
Assertions.checkState(isPendingReset());
|
||||||
if (durationUs != C.UNSET_TIME_US && pendingResetPositionUs >= durationUs) {
|
if (durationUs != C.UNSET_TIME_US && pendingResetPositionUs >= durationUs) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue