mirror of
https://github.com/revanced/revanced-patches
synced 2025-01-13 00:07:32 +01:00
fix(YouTube - Force original audio): Use correct original audio stream if app language is not English
This commit is contained in:
parent
f342e26997
commit
0d2017133e
@ -6,7 +6,7 @@ import app.revanced.extension.youtube.settings.Settings;
|
||||
@SuppressWarnings("unused")
|
||||
public class ForceOriginalAudioPatch {
|
||||
|
||||
private static final String DEFAULT_AUDIO_TRACKS_IDENTIFIER = "original";
|
||||
private static final String DEFAULT_AUDIO_TRACKS_SUFFIX = ".4";
|
||||
|
||||
/**
|
||||
* Injection point.
|
||||
@ -17,7 +17,7 @@ public class ForceOriginalAudioPatch {
|
||||
return isDefault;
|
||||
}
|
||||
|
||||
if (audioTrackDisplayName.isEmpty()) {
|
||||
if (audioTrackId.isEmpty()) {
|
||||
// Older app targets can have empty audio tracks and these might be placeholders.
|
||||
// The real audio tracks are called after these.
|
||||
return isDefault;
|
||||
@ -26,7 +26,7 @@ public class ForceOriginalAudioPatch {
|
||||
Logger.printDebug(() -> "default: " + String.format("%-5s", isDefault) + " id: "
|
||||
+ String.format("%-8s", audioTrackId) + " name:" + audioTrackDisplayName);
|
||||
|
||||
final boolean isOriginal = audioTrackDisplayName.contains(DEFAULT_AUDIO_TRACKS_IDENTIFIER);
|
||||
final boolean isOriginal = audioTrackId.endsWith(DEFAULT_AUDIO_TRACKS_SUFFIX);
|
||||
if (isOriginal) {
|
||||
Logger.printDebug(() -> "Using audio: " + audioTrackId);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user