Piped-Backend
Piped-Backend copied to clipboard
Sort audio bitrates to prevent low quality audio
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 https://github.com/TeamPiped/Piped/issues/1441