mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +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.");
|
+ " media items with an ad tag uri.");
|
||||||
return mediaSource;
|
return mediaSource;
|
||||||
}
|
}
|
||||||
|
@Nullable
|
||||||
AdsLoader adsLoader = adSupportProvider.getAdsLoader(mediaItem.playbackProperties.adTagUri);
|
AdsLoader adsLoader = adSupportProvider.getAdsLoader(mediaItem.playbackProperties.adTagUri);
|
||||||
if (adsLoader == null) {
|
if (adsLoader == null) {
|
||||||
Log.w(TAG, "Playing media without ads. No AdsLoader for provided adTagUri");
|
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.junit.runner.RunWith;
|
||||||
import org.robolectric.annotation.Config;
|
import org.robolectric.annotation.Config;
|
||||||
|
|
||||||
/**
|
/** Unit tests for {@link DefaultAudioSink}. */
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
public final class DefaultAudioSinkTest {
|
public final class DefaultAudioSinkTest {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1260,8 +1260,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
|
||||||
if (initializationDataBytes != null) {
|
if (initializationDataBytes != null) {
|
||||||
if (MimeTypes.AUDIO_AAC.equals(mimeType)) {
|
if (MimeTypes.AUDIO_AAC.equals(mimeType)) {
|
||||||
// Update sampleRate and channelCount from the AudioSpecificConfig initialization
|
// Update sampleRate and channelCount from the AudioSpecificConfig initialization
|
||||||
// data,
|
// data, which is more reliable. See [Internal: b/10903778].
|
||||||
// which is more reliable. See [Internal: b/10903778].
|
|
||||||
AacUtil.Config aacConfig = AacUtil.parseAudioSpecificConfig(initializationDataBytes);
|
AacUtil.Config aacConfig = AacUtil.parseAudioSpecificConfig(initializationDataBytes);
|
||||||
sampleRate = aacConfig.sampleRateHz;
|
sampleRate = aacConfig.sampleRateHz;
|
||||||
channelCount = aacConfig.channelCount;
|
channelCount = aacConfig.channelCount;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue