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 4b1755141..a44e371bf 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 @@ -302,8 +302,14 @@ private fun getReference(instructions: List, offset: Int, op /** * Hook the video speed selected by the user. */ -fun userSelectedPlaybackSpeedHook(targetMethodClass: String, targetMethodName: String) = +fun userSelectedPlaybackSpeedHook(targetMethodClass: String, targetMethodName: String) { + legacySpeedSelectionInsertMethod.addInstruction( + legacySpeedSelectionInsertIndex++, + "invoke-static { v$legacySpeedSelectionValueRegister }, $targetMethodClass->$targetMethodName(F)V" + ) + speedSelectionInsertMethod.addInstruction( speedSelectionInsertIndex++, - "invoke-static {v$speedSelectionValueRegister}, $targetMethodClass->$targetMethodName(F)V", + "invoke-static { v$speedSelectionValueRegister }, $targetMethodClass->$targetMethodName(F)V", ) +}