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: Media source always played if close file when inactive is checked #10980

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sugam-Chand-M
Copy link

Description

Even when the "Close when Inactive" property is checked and the source is inactive, the media was being played.
Issue - [ #10676 ]

Motivation and Context

This PR aims at resolving the issue by pausing the media play when the source is inactive and the "Close when Inactive" property is checked.
Issue - [ #10676 ]

How Has This Been Tested?

Tested manually in Windows 11.
Added a video drive link - Video Link of the fix working

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.

@WizardCM WizardCM added the Bug Fix Non-breaking change which fixes an issue label Jul 13, 2024
@SuslikV
Copy link
Contributor

SuslikV commented Jul 23, 2024

I think, the fix is incorrect. The option meaning changed in this PR. This may lead to confusion in future when new programmers will read the code.

The option to "close file" designed to free the file handler. Thus, the file can be in use and not exclusively by OBS.
Maybe the tip to the option is not clear enough and could be reworded (don't know is it really worth so much attention or not):

CloseFileWhenInactive="Close file when inactive"
CloseFileWhenInactive.ToolTip="Closes the file when the source is not being displayed on the stream or\nrecording. This allows the file to be changed when the source isn't active,\nbut there may be some startup delay when the source reactivates."

here the phrase "This allows the file to be changed..." has wider meaning: the file can be renamed, old file can be deleted and new file can be created with the same name, whole content of the media file can be modified (edited) when this option is checked.

In my opinion, the "Pause of playback" and "File close" is completely different actions. Current OBS logic states that media continues its playback even when the media source is not in the current scene ("not active" in terms of OBS - not shown in the stream/recording).

Yes, logically the "close of the file" is exclusive to the "not active" state of the source, but defaults of OBS is to "always playback" the source (and never stop playback until media ends or loop is forced).

The proposed changes can be considered as a fix, but previously such huge changes in logic were implemented as versioned variants of the sources (to keep behavior unchanged for scenes that already created by users). Maybe additional checkbox to "force the pause when media is not active" - is a better option here? For example, similar option exist for VLC Source of OBS.

One more thing... (includes 3 questions)
"not active" in terms of OBS - should it include playback of the media or shouldn't?

  1. In other words, if media playbacks (in background, in other scene, not appears in the stream/recording) - is this still "active" source or not in your opinion?
  2. "Paused" media - is this "active" source or not?
  3. "Stopped" media - is this "active" source or not?

@Sugam-Chand-M
Copy link
Author

Hi @SuslikV

Sorry for the very delayed response

"Close the file when inactive" option is for not displaying the sources when it is inactive and not to be deleted from the source.
When the product was designed and coded, I believe they have considered the scenario where if the user wants to temporarily disable the source which shouldn't be visible so they have included this option.

For the questions,

  1. Ideally when the source is inactive, the media shouldn't not be played or should be paused and played from the position when it becomes active again
  2. It can be either, active or inactive, its like inactive => paused but vice versa is not true
  3. Same as the answer for 2nd

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants