mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-18 07:02:28 +01:00
fix(YouTube - Spoof video streams): Resolve playback dropping frames (#6051)
This commit is contained in:
committed by
GitHub
parent
6a799110d7
commit
a62ee43441
@@ -39,7 +39,7 @@ public class SpoofVideoStreamsPatch {
|
|||||||
@Nullable
|
@Nullable
|
||||||
private static volatile AppLanguage languageOverride;
|
private static volatile AppLanguage languageOverride;
|
||||||
|
|
||||||
private static volatile ClientType preferredClient = ClientType.ANDROID_VR_1_61_48;
|
private static volatile ClientType preferredClient = ClientType.ANDROID_VR_1_43_32;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return If this patch was included during patching.
|
* @return If this patch was included during patching.
|
||||||
|
|||||||
@@ -18,28 +18,20 @@ public class SpoofVideoStreamsPatch {
|
|||||||
* Injection point.
|
* Injection point.
|
||||||
*/
|
*/
|
||||||
public static void setClientOrderToUse() {
|
public static void setClientOrderToUse() {
|
||||||
final boolean forceAVC = Settings.FORCE_AVC_CODEC.get();
|
|
||||||
|
|
||||||
// VR 1.61 uses VP9/AV1, and cannot force AVC.
|
|
||||||
ClientType client = Settings.SPOOF_VIDEO_STREAMS_CLIENT_TYPE.get();
|
ClientType client = Settings.SPOOF_VIDEO_STREAMS_CLIENT_TYPE.get();
|
||||||
if (forceAVC && client == ANDROID_VR_1_61_48) {
|
|
||||||
client = ANDROID_VR_1_43_32; // Use VR 1.43 instead.
|
|
||||||
|
if (Settings.FORCE_AVC_CODEC.get() && client == ANDROID_VR_1_61_48) {
|
||||||
|
// VR 1.61 uses VP9/AV1, and cannot force AVC. Use 1.43 instead.
|
||||||
|
client = ANDROID_VR_1_43_32;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ClientType> availableClients = forceAVC
|
List<ClientType> availableClients = List.of(
|
||||||
? List.of(
|
|
||||||
ANDROID_VR_1_43_32,
|
ANDROID_VR_1_43_32,
|
||||||
VISIONOS,
|
VISIONOS,
|
||||||
ANDROID_CREATOR,
|
ANDROID_CREATOR,
|
||||||
ANDROID_VR_1_61_48,
|
ANDROID_VR_1_61_48,
|
||||||
IPADOS)
|
IPADOS);
|
||||||
: List.of(
|
|
||||||
ANDROID_VR_1_61_48,
|
|
||||||
VISIONOS,
|
|
||||||
ANDROID_CREATOR,
|
|
||||||
ANDROID_VR_1_43_32,
|
|
||||||
IPADOS
|
|
||||||
);
|
|
||||||
|
|
||||||
app.revanced.extension.shared.spoof.SpoofVideoStreamsPatch.setClientsToUse(
|
app.revanced.extension.shared.spoof.SpoofVideoStreamsPatch.setClientsToUse(
|
||||||
availableClients, client);
|
availableClients, client);
|
||||||
|
|||||||
@@ -356,7 +356,7 @@ public class Settings extends BaseSettings {
|
|||||||
public static final BooleanSetting EXTERNAL_BROWSER = new BooleanSetting("revanced_external_browser", TRUE, true);
|
public static final BooleanSetting EXTERNAL_BROWSER = new BooleanSetting("revanced_external_browser", TRUE, true);
|
||||||
public static final BooleanSetting SPOOF_DEVICE_DIMENSIONS = new BooleanSetting("revanced_spoof_device_dimensions", FALSE, true,
|
public static final BooleanSetting SPOOF_DEVICE_DIMENSIONS = new BooleanSetting("revanced_spoof_device_dimensions", FALSE, true,
|
||||||
"revanced_spoof_device_dimensions_user_dialog_message");
|
"revanced_spoof_device_dimensions_user_dialog_message");
|
||||||
public static final EnumSetting<ClientType> SPOOF_VIDEO_STREAMS_CLIENT_TYPE = new EnumSetting<>("revanced_spoof_video_streams_client_type", ClientType.ANDROID_VR_1_61_48, true, parent(SPOOF_VIDEO_STREAMS));
|
public static final EnumSetting<ClientType> SPOOF_VIDEO_STREAMS_CLIENT_TYPE = new EnumSetting<>("revanced_spoof_video_streams_client_type", ClientType.ANDROID_VR_1_43_32, true, parent(SPOOF_VIDEO_STREAMS));
|
||||||
public static final BooleanSetting DEBUG_PROTOBUFFER = new BooleanSetting("revanced_debug_protobuffer", FALSE, false,
|
public static final BooleanSetting DEBUG_PROTOBUFFER = new BooleanSetting("revanced_debug_protobuffer", FALSE, false,
|
||||||
"revanced_debug_protobuffer_user_dialog_message", parent(BaseSettings.DEBUG));
|
"revanced_debug_protobuffer_user_dialog_message", parent(BaseSettings.DEBUG));
|
||||||
|
|
||||||
|
|||||||
@@ -83,12 +83,17 @@ public class SpoofStreamingDataSideEffectsPreference extends Preference {
|
|||||||
String summary = str("revanced_spoof_video_streams_about_no_audio_tracks");
|
String summary = str("revanced_spoof_video_streams_about_no_audio_tracks");
|
||||||
|
|
||||||
switch (clientType) {
|
switch (clientType) {
|
||||||
case ANDROID_VR_1_61_48 ->
|
|
||||||
summary += '\n' + str("revanced_spoof_video_streams_about_no_stable_volume");
|
|
||||||
case ANDROID_CREATOR ->
|
case ANDROID_CREATOR ->
|
||||||
summary += '\n' + str("revanced_spoof_video_streams_about_no_av1")
|
summary += '\n' + str("revanced_spoof_video_streams_about_no_stable_volume")
|
||||||
+ '\n' + str("revanced_spoof_video_streams_about_no_stable_volume")
|
+ '\n' + str("revanced_spoof_video_streams_about_no_av1")
|
||||||
+ '\n' + str("revanced_spoof_video_streams_about_no_force_original_audio");
|
+ '\n' + str("revanced_spoof_video_streams_about_no_force_original_audio");
|
||||||
|
case ANDROID_VR_1_43_32 ->
|
||||||
|
summary += '\n' + str("revanced_spoof_video_streams_about_no_stable_volume")
|
||||||
|
+ '\n' + str("revanced_spoof_video_streams_about_no_av1");
|
||||||
|
case ANDROID_VR_1_61_48 ->
|
||||||
|
summary = str("revanced_spoof_video_streams_about_dropped_frames")
|
||||||
|
+ '\n' + summary
|
||||||
|
+ '\n' + str("revanced_spoof_video_streams_about_no_stable_volume");
|
||||||
case IPADOS ->
|
case IPADOS ->
|
||||||
summary = str("revanced_spoof_video_streams_about_playback_failure")
|
summary = str("revanced_spoof_video_streams_about_playback_failure")
|
||||||
+ '\n' + str("revanced_spoof_video_streams_about_no_av1");
|
+ '\n' + str("revanced_spoof_video_streams_about_no_av1");
|
||||||
|
|||||||
@@ -137,12 +137,14 @@
|
|||||||
<app id="youtube">
|
<app id="youtube">
|
||||||
<patch id="misc.fix.playback.spoofVideoStreamsPatch">
|
<patch id="misc.fix.playback.spoofVideoStreamsPatch">
|
||||||
<string-array name="revanced_spoof_video_streams_client_type_entries">
|
<string-array name="revanced_spoof_video_streams_client_type_entries">
|
||||||
<item>Android VR</item>
|
<item>Android VR 1.43</item>
|
||||||
|
<item>Android VR 1.61</item>
|
||||||
<item>Android Studio</item>
|
<item>Android Studio</item>
|
||||||
<item>visionOS</item>
|
<item>visionOS</item>
|
||||||
<item>iPadOS</item>
|
<item>iPadOS</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
<string-array name="revanced_spoof_video_streams_client_type_entry_values">
|
<string-array name="revanced_spoof_video_streams_client_type_entry_values">
|
||||||
|
<item>ANDROID_VR_1_43_32</item>
|
||||||
<item>ANDROID_VR_1_61_48</item>
|
<item>ANDROID_VR_1_61_48</item>
|
||||||
<item>ANDROID_CREATOR</item>
|
<item>ANDROID_CREATOR</item>
|
||||||
<item>VISIONOS</item>
|
<item>VISIONOS</item>
|
||||||
|
|||||||
@@ -1687,6 +1687,7 @@ Limitations:
|
|||||||
<string name="revanced_spoof_video_streams_about_no_audio_tracks">• Audio track menu is missing</string>
|
<string name="revanced_spoof_video_streams_about_no_audio_tracks">• Audio track menu is missing</string>
|
||||||
<string name="revanced_spoof_video_streams_about_no_av1">• No AV1 video codec</string>
|
<string name="revanced_spoof_video_streams_about_no_av1">• No AV1 video codec</string>
|
||||||
<string name="revanced_spoof_video_streams_about_no_stable_volume">• Stable volume is not available</string>
|
<string name="revanced_spoof_video_streams_about_no_stable_volume">• Stable volume is not available</string>
|
||||||
|
<string name="revanced_spoof_video_streams_about_dropped_frames">• Playback may stutter or drop frames</string>
|
||||||
<string name="revanced_spoof_video_streams_about_kids_videos">• Kids videos may not play when logged out or in incognito mode</string>
|
<string name="revanced_spoof_video_streams_about_kids_videos">• Kids videos may not play when logged out or in incognito mode</string>
|
||||||
<!-- "Force original audio" should use the same text as revanced_force_original_audio_title -->
|
<!-- "Force original audio" should use the same text as revanced_force_original_audio_title -->
|
||||||
<string name="revanced_spoof_video_streams_about_no_force_original_audio">• Force original audio is not available</string>
|
<string name="revanced_spoof_video_streams_about_no_force_original_audio">• Force original audio is not available</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user