mirror of
https://github.com/samsonjs/media.git
synced 2026-04-08 11:45:51 +00:00
Fix miscellaneous nits
PiperOrigin-RevId: 326208366
This commit is contained in:
parent
b02398ff75
commit
6aeacd70bc
3 changed files with 3 additions and 14 deletions
|
|
@ -379,6 +379,7 @@ public final class DefaultMediaSourceFactory implements MediaSourceFactory {
|
|||
+ " media items with an ad tag uri.");
|
||||
return mediaSource;
|
||||
}
|
||||
@Nullable
|
||||
AdsLoader adsLoader = adSupportProvider.getAdsLoader(mediaItem.playbackProperties.adTagUri);
|
||||
if (adsLoader == null) {
|
||||
Log.w(TAG, "Playing media without ads. No AdsLoader for provided adTagUri");
|
||||
|
|
|
|||
|
|
@ -33,18 +33,7 @@ import org.junit.Test;
|
|||
import org.junit.runner.RunWith;
|
||||
import org.robolectric.annotation.Config;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link DefaultAudioSink}.
|
||||
*
|
||||
* <p>Note: the Robolectric-provided AudioTrack instantiated in the audio sink uses only the Java
|
||||
* part of AudioTrack with a {@code ShadowPlayerBase} underneath. This means it will not consume
|
||||
* data (i.e., the {@link android.media.AudioTrack#write} methods just return 0), so these tests are
|
||||
* currently limited to verifying behavior that doesn't rely on consuming data, and the position
|
||||
* will stay at its initial value. For example, we can't verify {@link
|
||||
* AudioSink#handleBuffer(ByteBuffer, long, int)} handling a complete buffer, or queueing audio then
|
||||
* draining to the end of the stream. This could be worked around by having a test-only mode where
|
||||
* {@link DefaultAudioSink} automatically treats audio as consumed.
|
||||
*/
|
||||
/** Unit tests for {@link DefaultAudioSink}. */
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public final class DefaultAudioSinkTest {
|
||||
|
||||
|
|
|
|||
|
|
@ -1260,8 +1260,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
|
|||
if (initializationDataBytes != null) {
|
||||
if (MimeTypes.AUDIO_AAC.equals(mimeType)) {
|
||||
// Update sampleRate and channelCount from the AudioSpecificConfig initialization
|
||||
// data,
|
||||
// which is more reliable. See [Internal: b/10903778].
|
||||
// data, which is more reliable. See [Internal: b/10903778].
|
||||
AacUtil.Config aacConfig = AacUtil.parseAudioSpecificConfig(initializationDataBytes);
|
||||
sampleRate = aacConfig.sampleRateHz;
|
||||
channelCount = aacConfig.channelCount;
|
||||
|
|
|
|||
Loading…
Reference in a new issue