mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-03-11 02:56:19 -04:00
UI: Don't call obs_source_get_output_flags on a NULL source
This commit is contained in:
@@ -3393,16 +3393,20 @@ void OBSBasic::SourceToolBarActionsSetEnabled()
|
||||
|
||||
void OBSBasic::UpdateTransformShortcuts()
|
||||
{
|
||||
bool hasVideo = false;
|
||||
|
||||
OBSSource source = obs_sceneitem_get_source(GetCurrentSceneItem());
|
||||
uint32_t flags = obs_source_get_output_flags(source);
|
||||
bool audioOnly = (flags & OBS_SOURCE_VIDEO) == 0;
|
||||
|
||||
ui->actionEditTransform->setEnabled(!audioOnly);
|
||||
ui->actionCopyTransform->setEnabled(!audioOnly);
|
||||
ui->actionPasteTransform->setEnabled(audioOnly ? false
|
||||
: hasCopiedTransform);
|
||||
if (source) {
|
||||
uint32_t flags = obs_source_get_output_flags(source);
|
||||
hasVideo = (flags & OBS_SOURCE_VIDEO) != 0;
|
||||
}
|
||||
|
||||
ui->actionResetTransform->setEnabled(!audioOnly);
|
||||
ui->actionEditTransform->setEnabled(hasVideo);
|
||||
ui->actionCopyTransform->setEnabled(hasVideo);
|
||||
ui->actionPasteTransform->setEnabled(hasVideo ? hasCopiedTransform
|
||||
: false);
|
||||
ui->actionResetTransform->setEnabled(hasVideo);
|
||||
}
|
||||
|
||||
void OBSBasic::UpdateContextBar(bool force)
|
||||
|
||||
Reference in New Issue
Block a user