mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Log warnings when Transformer sees unsupported track type
PiperOrigin-RevId: 685649866
This commit is contained in:
parent
5acb483222
commit
17c0ff8ba8
@ -41,6 +41,7 @@ import androidx.media3.common.Player;
|
||||
import androidx.media3.common.Timeline;
|
||||
import androidx.media3.common.Tracks;
|
||||
import androidx.media3.common.util.Clock;
|
||||
import androidx.media3.common.util.Log;
|
||||
import androidx.media3.common.util.UnstableApi;
|
||||
import androidx.media3.exoplayer.DefaultLoadControl;
|
||||
import androidx.media3.exoplayer.ExoPlayer;
|
||||
@ -134,6 +135,8 @@ public final class ExoPlayerAssetLoader implements AssetLoader {
|
||||
}
|
||||
}
|
||||
|
||||
private static final String TAG = "ExoPlayerAssetLoader";
|
||||
|
||||
/**
|
||||
* The timeout value, in milliseconds, to set on the internal {@link ExoPlayer} instance when
|
||||
* running on an emulator.
|
||||
@ -336,6 +339,7 @@ public final class ExoPlayerAssetLoader implements AssetLoader {
|
||||
trackCount++;
|
||||
}
|
||||
|
||||
maybeWarnUnsupportedTrackTypes(tracks);
|
||||
if (trackCount > 0) {
|
||||
assetLoaderListener.onTrackCount(trackCount);
|
||||
// Start the renderers after having registered all the tracks to make sure the AssetLoader
|
||||
@ -367,6 +371,16 @@ public final class ExoPlayerAssetLoader implements AssetLoader {
|
||||
}
|
||||
}
|
||||
|
||||
private static void maybeWarnUnsupportedTrackTypes(Tracks tracks) {
|
||||
for (int i = 0; i < tracks.getGroups().size(); i++) {
|
||||
@C.TrackType int trackType = tracks.getGroups().get(i).getType();
|
||||
if (trackType == C.TRACK_TYPE_AUDIO || trackType == C.TRACK_TYPE_VIDEO) {
|
||||
continue;
|
||||
}
|
||||
Log.w(TAG, "Unsupported track type: " + trackType);
|
||||
}
|
||||
}
|
||||
|
||||
private static long getReleaseTimeoutMs() {
|
||||
// b/297916906 - Emulators need a larger timeout for releasing.
|
||||
return isRunningOnEmulator()
|
||||
|
Loading…
x
Reference in New Issue
Block a user