1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-25 04:22:30 +01:00

fix: update stream sizes when audio track changed

This commit is contained in:
ThetaDev 2023-03-21 16:58:36 +01:00
parent ed06f559ae
commit 694418d30d

View File

@ -433,9 +433,6 @@ public class DownloadDialog extends DialogFragment
dialogBinding.audioTrackSpinner.setAdapter(audioTrackAdapter); dialogBinding.audioTrackSpinner.setAdapter(audioTrackAdapter);
dialogBinding.audioTrackSpinner.setSelection(selectedAudioStreamIndex); dialogBinding.audioTrackSpinner.setSelection(selectedAudioStreamIndex);
dialogBinding.audioStreamSpinner.setAdapter(audioStreamsAdapter);
dialogBinding.audioStreamSpinner.setSelection(selectedAudioIndex);
} }
private void setupAudioSpinner() { private void setupAudioSpinner() {
@ -445,6 +442,8 @@ public class DownloadDialog extends DialogFragment
dialogBinding.qualitySpinner.setVisibility(View.GONE); dialogBinding.qualitySpinner.setVisibility(View.GONE);
setRadioButtonsState(true); setRadioButtonsState(true);
dialogBinding.audioStreamSpinner.setAdapter(audioStreamsAdapter);
dialogBinding.audioStreamSpinner.setSelection(selectedAudioIndex);
dialogBinding.audioStreamSpinner.setVisibility(View.VISIBLE); dialogBinding.audioStreamSpinner.setVisibility(View.VISIBLE);
dialogBinding.audioTrackSpinner.setVisibility( dialogBinding.audioTrackSpinner.setVisibility(
wrappedAudioTracks.size() > 1 ? View.VISIBLE : View.GONE); wrappedAudioTracks.size() > 1 ? View.VISIBLE : View.GONE);
@ -619,8 +618,12 @@ public class DownloadDialog extends DialogFragment
onItemSelectedSetFileName(); onItemSelectedSetFileName();
break; break;
case R.id.audio_track_spinner: case R.id.audio_track_spinner:
final boolean trackChanged = selectedAudioStreamIndex != position;
selectedAudioStreamIndex = position; selectedAudioStreamIndex = position;
updateSecondaryStreams(); if (trackChanged) {
updateSecondaryStreams();
fetchStreamsSize();
}
break; break;
case R.id.audio_stream_spinner: case R.id.audio_stream_spinner:
selectedAudioIndex = position; selectedAudioIndex = position;