Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Fix a bug with Output Settings not updating & Toggle audio multi-tracks correctly #10294

Merged
merged 2 commits into from
Feb 27, 2024

Conversation

pkviet
Copy link
Member

@pkviet pkviet commented Feb 27, 2024

Description

This does two things:

  1. This removes the LoadOutputSettings() called in SaveStream1Settings. It caused a bug when trying to save Output settings when both Stream and Output settings have been changed but the changes have not been applied by hitting the 'Apply' button in Settings.
    Credits: Rodney made the correct guess for the faulty line.
  2. This fixes the display of audio multi-tracks which must alternate between radio buttons (single track protocols) to checkboxes
    (mpegts). The LoadOutputSettings call was used to do that update but it was too broad. Instead we use (a) the signal when a service is changed to switch back from mpegts multi-track to single track; (b) the signal when a URL is input in the Server text field of Custom service; (c) when Stream settings are saved.

Motivation and Context

Fixes a bug found in 30.1 beta.
The function was introduced by me in #9028 .
It was used to toggle the display of audio multi-tracks checkboxes instead of radio buttons.

The repro steps in beta are as follows:

  • change the stream service but don't hit apply,
  • change the output settings from Simple to Advanced or the converse,
  • hit Apply
  • the output Settings are reverted.

The reason why this occurs is because when one hits apply, the stream settings are saved before the output settings.
But since they load the output settings, the changes for the outputs are reverted.

But we still want to display correctly audio multi track buttons (either radio or checkboxes). This is the goal of the second commit.

How Has This Been Tested?

The bug is fixed.
SRT multi-track audio still works (tested from obs to wowza).
Multi-track buttons alternate correctly between radio or checkboxes as a function of the Service or as a function of the protocol when Custom service is picked.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

This removes the LoadOutputSettings() called in SaveStream1Settings.
It caused a bug when trying to save Output settings when both Stream
and Output settings have been changed but the changes have not been
applied by hitting the 'Apply' button in Settings.

Signed-off-by: pkv <pkv@obsproject.com>
@pkviet pkviet added Bug Fix Non-breaking change which fixes an issue Seeking Testers Build artifacts on CI labels Feb 27, 2024
@pkviet pkviet added this to the OBS Studio 30.1 milestone Feb 27, 2024
@RytoEX RytoEX changed the title UI: Fix a bug with Output Settings not updating & Toggle audio multi-tracks correctly. UI: Fix a bug with Output Settings not updating & Toggle audio multi-tracks correctly Feb 27, 2024
@pkviet pkviet force-pushed the ui_stream_fix branch 2 times, most recently from 5bd04d3 to 33aa419 Compare February 27, 2024 08:41
@pkviet pkviet marked this pull request as draft February 27, 2024 09:00
@pkviet
Copy link
Member Author

pkviet commented Feb 27, 2024

Putting this to Draft. Will fix the CI issues later today

Copy link
Collaborator

@tytan652 tytan652 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also rename allowsMultiTrack to AllowsMultiTrack to match our function naming.

UI/window-basic-settings.hpp Outdated Show resolved Hide resolved
@pkviet
Copy link
Member Author

pkviet commented Feb 27, 2024

Maybe also rename allowsMultiTrack to AllowsMultiTrack to match our function naming.

thanks, done.

@pkviet pkviet marked this pull request as ready for review February 27, 2024 13:51
@RytoEX RytoEX requested a review from derrod February 27, 2024 19:53
Copy link
Member

@RytoEX RytoEX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Questions.

UI/window-basic-settings.cpp Outdated Show resolved Hide resolved
UI/window-basic-settings.cpp Outdated Show resolved Hide resolved
This toggles audio multi track display in Output settings when:
1. When there is a signal that a stream service is changed to a non
custom one. Indeed multi-track audio is only available with Custom
service and only with SRT or RIST protocols.
2. When a Custom service is picked, and SRT or RIST are detected in the
server URL.
3. When Stream settings are saved when one hits Apply.
This is in addition to the toggling done when loading Stream Settings.

Signed-off-by: pkv <pkv@obsproject.com>
@RytoEX RytoEX self-assigned this Feb 27, 2024
@RytoEX RytoEX merged commit 5bd22af into obsproject:master Feb 27, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fix Non-breaking change which fixes an issue Seeking Testers Build artifacts on CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants