Skip to content

Commit

Permalink
Fix a segfault crash related to JSON-API grabber control (fixes #318)
Browse files Browse the repository at this point in the history
  • Loading branch information
awawa-dev committed Aug 9, 2022
1 parent 90a2cfa commit a5ec340
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion include/base/GrabberWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ private slots:
void StateChanged(QString device, QString videoMode);
void cecKeyPressed(int key);
void benchmarkUpdate(int status, QString message);
void setBrightnessContrastSaturationHue(int brightness, int contrast, int saturation, int hue);

public:
int getHdrToneMappingEnabled();
Expand All @@ -93,7 +94,7 @@ public slots:
void setFpsSoftwareDecimation(int decimation);
void setHdrToneMappingEnabled(int mode);
void setEncoding(QString enc);
void setBrightnessContrastSaturationHue(int brightness, int contrast, int saturation, int hue);
void setBrightnessContrastSaturationHueHandler(int brightness, int contrast, int saturation, int hue);
void setQFrameDecimation(int setQframe);
void handleSettingsUpdate(settings::type type, const QJsonDocument& config);

Expand Down
6 changes: 4 additions & 2 deletions sources/base/GrabberWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ GrabberWrapper::GrabberWrapper(const QString& grabberName, Grabber* ggrabber)
// listen for source requests
connect(GlobalSignals::getInstance(), &GlobalSignals::requestSource, this, &GrabberWrapper::handleSourceRequest);

connect(this, &GrabberWrapper::cecKeyPressed, this, &GrabberWrapper::cecKeyPressedHandler);
connect(this, &GrabberWrapper::cecKeyPressed, this, &GrabberWrapper::cecKeyPressedHandler);

connect(this, &GrabberWrapper::setBrightnessContrastSaturationHue, this, &GrabberWrapper::setBrightnessContrastSaturationHueHandler);

}

Expand Down Expand Up @@ -347,7 +349,7 @@ void GrabberWrapper::setEncoding(QString enc)
_grabber->setEncoding(enc);
}

void GrabberWrapper::setBrightnessContrastSaturationHue(int brightness, int contrast, int saturation, int hue)
void GrabberWrapper::setBrightnessContrastSaturationHueHandler(int brightness, int contrast, int saturation, int hue)
{
if (_grabber != nullptr)
_grabber->setBrightnessContrastSaturationHue(brightness, contrast, saturation, hue);
Expand Down

0 comments on commit a5ec340

Please sign in to comment.