alexandroid/decompiled/jadx/sources/com/google/android/exoplayer2/PlaybackParameters.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

57 lines
1.8 KiB
Java

package com.google.android.exoplayer2;
import androidx.annotation.CheckResult;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.util.Assertions;
import com.google.android.exoplayer2.util.Util;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
/* loaded from: classes7.dex */
public final class PlaybackParameters {
public static final PlaybackParameters DEFAULT = new PlaybackParameters(1.0f);
public final float pitch;
private final int scaledUsPerMs;
public final float speed;
public PlaybackParameters(float f, float f2) {
Assertions.checkArgument(f > 0.0f);
Assertions.checkArgument(f2 > 0.0f);
this.speed = f;
this.pitch = f2;
this.scaledUsPerMs = Math.round(f * 1000.0f);
}
public boolean equals(@Nullable Object obj) {
if (this == obj) {
return true;
}
if (obj != null && PlaybackParameters.class == obj.getClass()) {
PlaybackParameters playbackParameters = (PlaybackParameters) obj;
if (this.speed == playbackParameters.speed && this.pitch == playbackParameters.pitch) {
return true;
}
}
return false;
}
public long getMediaTimeUsForPlayoutTimeMs(long j) {
return j * this.scaledUsPerMs;
}
public int hashCode() {
return Float.floatToRawIntBits(this.pitch) + ((Float.floatToRawIntBits(this.speed) + 527) * 31);
}
public String toString() {
return Util.formatInvariant("PlaybackParameters(speed=%.2f, pitch=%.2f)", Float.valueOf(this.speed), Float.valueOf(this.pitch));
}
@CheckResult
public PlaybackParameters withSpeed(float f) {
return new PlaybackParameters(f, this.pitch);
}
public PlaybackParameters(float f) {
this(f, 1.0f);
}
}