Sort audio bitrates to prevent low quality audio #777
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When a user selects a video resolution manually (not from preferences), the player seems to select the first matching variant track. That typically means that selecting e.g. 2160p results in 40kbps audio, instead of 135kbps. This change sorts audio bitrates in the backend so that the highest qualities are first to avoid low quality audio.
This is a hack, not a proper fix, but I know Java and I don't know Vue or JS. Presumably there's some way to make the frontend select the higher quality audio.
Note that if a user prefers qualities below 480p I think they will now have high-quality audio, instead of low quality, which is a change from present. Relevant code:
https://github.com/TeamPiped/Piped/blob/40314cd0f0bdc6563cf65090fc4e5c431f956b8b/src/components/VideoPlayer.vue#L571-L576
Since audio bitrates are now sorted, default audio is HQ instead of LQ.
Should fix TeamPiped/Piped#1441