diff --git a/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/video/CustomPlaybackSpeedPatch.java b/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/video/CustomPlaybackSpeedPatch.java index d54692153..cca3c4ff4 100644 --- a/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/video/CustomPlaybackSpeedPatch.java +++ b/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/video/CustomPlaybackSpeedPatch.java @@ -20,6 +20,8 @@ import app.revanced.extension.youtube.utils.VideoUtils; @SuppressWarnings("unused") public class CustomPlaybackSpeedPatch { + private static final float PLAYBACK_SPEED_AUTO = Settings.DEFAULT_PLAYBACK_SPEED.defaultValue; + /** * Maximum playback speed, exclusive value. Custom speeds must be less than this value. *

@@ -27,7 +29,7 @@ public class CustomPlaybackSpeedPatch { * and the UI selector starts flickering and acting weird. * Over 10x and the speeds show up out of order in the UI selector. */ - public static final float MAXIMUM_PLAYBACK_SPEED = 8; + public static final float PLAYBACK_SPEED_MAXIMUM = 8; private static final String[] defaultSpeedEntries; private static final String[] defaultSpeedEntryValues; /** @@ -128,8 +130,8 @@ public class CustomPlaybackSpeedPatch { throw new IllegalArgumentException(); } - if (speedFloat > MAXIMUM_PLAYBACK_SPEED) { - resetCustomSpeeds(str("revanced_custom_playback_speeds_invalid", MAXIMUM_PLAYBACK_SPEED)); + if (speedFloat > PLAYBACK_SPEED_MAXIMUM) { + resetCustomSpeeds(str("revanced_custom_playback_speeds_invalid", PLAYBACK_SPEED_MAXIMUM)); loadCustomSpeeds(); return; } diff --git a/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/video/PlaybackSpeedPatch.java b/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/video/PlaybackSpeedPatch.java index e4a2417fa..6964d3625 100644 --- a/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/video/PlaybackSpeedPatch.java +++ b/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/video/PlaybackSpeedPatch.java @@ -84,7 +84,7 @@ public class PlaybackSpeedPatch { // With the 0.05x menu, if the speed is set by integrations to higher than 2.0x // then the menu will allow increasing without bounds but the max speed is // still capped to under 8.0x. - playbackSpeed = Math.min(playbackSpeed, CustomPlaybackSpeedPatch.MAXIMUM_PLAYBACK_SPEED - 0.05f); + playbackSpeed = Math.min(playbackSpeed, CustomPlaybackSpeedPatch.PLAYBACK_SPEED_MAXIMUM - 0.05f); // Prevent toast spamming if using the 0.05x adjustments. // Show exactly one toast after the user stops interacting with the speed menu. diff --git a/patches/src/main/kotlin/app/revanced/patches/music/general/spoofappversion/SpoofAppVersionPatch.kt b/patches/src/main/kotlin/app/revanced/patches/music/general/spoofappversion/SpoofAppVersionPatch.kt index 268a10c96..118dd8735 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/general/spoofappversion/SpoofAppVersionPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/general/spoofappversion/SpoofAppVersionPatch.kt @@ -21,7 +21,9 @@ import app.revanced.util.findMethodOrThrow private var defaultValue = "false" -private val spoofAppVersionBytecodePatch = bytecodePatch { +private val spoofAppVersionBytecodePatch = bytecodePatch( + description = "spoofAppVersionBytecodePatch" +) { dependsOn( baseSpoofAppVersionPatch("$GENERAL_CLASS_DESCRIPTOR->getVersionOverride(Ljava/lang/String;)Ljava/lang/String;"), versionCheckPatch, diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/video/information/VideoInformationPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/video/information/VideoInformationPatch.kt index e149cc609..5fff83ae5 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/video/information/VideoInformationPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/video/information/VideoInformationPatch.kt @@ -405,6 +405,7 @@ val videoInformationPatch = bytecodePatch( null, ImmutableMethodImplementation( 4, """ + # Check if the playback speed is not auto (-2.0f) const/4 v0, 0x0 cmpg-float v0, v3, v0 if-lez v0, :ignore