UI: Don't call obs_source_get_output_flags on a NULL source
This commit is contained in:
parent
cb531b5034
commit
6a42d88ca7
1 changed files with 11 additions and 7 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue