mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-05-24 16:28:07 -04:00
Revert "UI: Stop recording when disk space is low"
This reverts commit d9a4842604.
Some people have been reporting that this is being triggered despite
having plenty of disk space. So revert this until this issue is
investigated in more detail.
This commit is contained in:
@@ -287,10 +287,6 @@ OBSBasic::OBSBasic(QWidget *parent)
|
||||
SLOT(UpdateCPUUsage()));
|
||||
cpuUsageTimer->start(3000);
|
||||
|
||||
diskFullTimer = new QTimer(this);
|
||||
connect(diskFullTimer, SIGNAL(timeout()), this,
|
||||
SLOT(CheckDiskSpaceRemaining()));
|
||||
|
||||
QAction *renameScene = new QAction(ui->scenesDock);
|
||||
renameScene->setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
||||
connect(renameScene, SIGNAL(triggered()), this, SLOT(EditSceneName()));
|
||||
@@ -5350,12 +5346,6 @@ void OBSBasic::StartRecording()
|
||||
if (disableOutputsRef)
|
||||
return;
|
||||
|
||||
if (LowDiskSpace()) {
|
||||
DiskSpaceMessage();
|
||||
ui->recordButton->setChecked(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (api)
|
||||
api->on_event(OBS_FRONTEND_EVENT_RECORDING_STARTING);
|
||||
|
||||
@@ -5400,9 +5390,6 @@ void OBSBasic::RecordingStart()
|
||||
if (api)
|
||||
api->on_event(OBS_FRONTEND_EVENT_RECORDING_STARTED);
|
||||
|
||||
if (!diskFullTimer->isActive())
|
||||
diskFullTimer->start(1000);
|
||||
|
||||
OnActivate();
|
||||
UpdatePause();
|
||||
|
||||
@@ -5467,9 +5454,6 @@ void OBSBasic::RecordingStop(int code, QString last_error)
|
||||
if (api)
|
||||
api->on_event(OBS_FRONTEND_EVENT_RECORDING_STOPPED);
|
||||
|
||||
if (diskFullTimer->isActive())
|
||||
diskFullTimer->stop();
|
||||
|
||||
if (remuxAfterRecord)
|
||||
AutoRemux();
|
||||
|
||||
@@ -5528,12 +5512,6 @@ void OBSBasic::StartReplayBuffer()
|
||||
return;
|
||||
}
|
||||
|
||||
if (LowDiskSpace()) {
|
||||
DiskSpaceMessage();
|
||||
replayBufferButton->setChecked(false);
|
||||
return;
|
||||
}
|
||||
|
||||
obs_output_t *output = outputHandler->replayBuffer;
|
||||
obs_data_t *hotkeys = obs_hotkeys_save_output(output);
|
||||
obs_data_array_t *bindings =
|
||||
@@ -7543,42 +7521,3 @@ void OBSBasic::UpdatePause(bool activate)
|
||||
pause.reset();
|
||||
}
|
||||
}
|
||||
|
||||
#define MBYTE (1024ULL * 1024ULL)
|
||||
#define MBYTES_LEFT_STOP_REC 50ULL
|
||||
#define MAX_BYTES_LEFT (MBYTES_LEFT_STOP_REC * MBYTE)
|
||||
|
||||
void OBSBasic::DiskSpaceMessage()
|
||||
{
|
||||
blog(LOG_ERROR, "Recording stopped because of low disk space");
|
||||
|
||||
OBSMessageBox::critical(this, QTStr("Output.RecordNoSpace.Title"),
|
||||
QTStr("Output.RecordNoSpace.Msg"));
|
||||
}
|
||||
|
||||
bool OBSBasic::LowDiskSpace()
|
||||
{
|
||||
const char *mode = config_get_string(Config(), "Output", "Mode");
|
||||
const char *path =
|
||||
strcmp(mode, "Advanced")
|
||||
? config_get_string(Config(), "SimpleOutput",
|
||||
"FilePath")
|
||||
: config_get_string(Config(), "AdvOut", "RecFilePath");
|
||||
|
||||
uint64_t num_bytes = os_get_free_disk_space(path);
|
||||
|
||||
if (num_bytes < (MAX_BYTES_LEFT))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
void OBSBasic::CheckDiskSpaceRemaining()
|
||||
{
|
||||
if (LowDiskSpace()) {
|
||||
StopRecording();
|
||||
StopReplayBuffer();
|
||||
|
||||
DiskSpaceMessage();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,8 +172,6 @@ private:
|
||||
QPointer<OBSAbout> about;
|
||||
|
||||
QPointer<QTimer> cpuUsageTimer;
|
||||
QPointer<QTimer> diskFullTimer;
|
||||
|
||||
os_cpu_usage_info_t *cpuUsageInfo = nullptr;
|
||||
|
||||
OBSService service;
|
||||
@@ -558,8 +556,6 @@ private slots:
|
||||
void SceneCopyFilters();
|
||||
void ScenePasteFilters();
|
||||
|
||||
void CheckDiskSpaceRemaining();
|
||||
|
||||
private:
|
||||
/* OBS Callbacks */
|
||||
static void SceneReordered(void *data, calldata_t *params);
|
||||
@@ -585,12 +581,8 @@ private:
|
||||
static void HotkeyTriggered(void *data, obs_hotkey_id id, bool pressed);
|
||||
|
||||
void AutoRemux();
|
||||
|
||||
void UpdatePause(bool activate = true);
|
||||
|
||||
bool LowDiskSpace();
|
||||
void DiskSpaceMessage();
|
||||
|
||||
public:
|
||||
OBSSource GetProgramSource();
|
||||
OBSScene GetCurrentScene();
|
||||
|
||||
Reference in New Issue
Block a user