Advertisement
Guest User

Psim changes

a guest
Apr 2nd, 2020
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.59 KB | None | 0 0
  1. diff --git a/demo/main.cpp b/demo/main.cpp
  2. index 90e5e3c..02a4004 100644
  3. --- a/demo/main.cpp
  4. +++ b/demo/main.cpp
  5. @@ -613,6 +613,8 @@ void MainWin::setSendConfig(const QString &s)
  6.          ui.le_sendConfig->setEnabled(true);
  7.          ui.le_sendConfig->setText(s);
  8.          ui.le_sendConfig->setCursorPosition(0);
  9. +        if(ui.le_receiveConfig->text().isEmpty())
  10. +            ui.le_receiveConfig->setText(s);
  11.      } else {
  12.          ui.lb_sendConfig->setEnabled(false);
  13.          ui.le_sendConfig->setEnabled(false);
  14. diff --git a/gstprovider/devices.cpp b/gstprovider/devices.cpp
  15. index 1d542a5..e5519a4 100644
  16. --- a/gstprovider/devices.cpp
  17. +++ b/gstprovider/devices.cpp
  18. @@ -294,9 +294,11 @@ void DeviceMonitor::onDeviceRemoved(const GstDevice &dev)
  19.  DeviceMonitor::DeviceMonitor(GstMainLoop *mainLoop) : d(new Private(this))
  20.  {
  21.      qRegisterMetaType<GstDevice>("GstDevice");
  22. -    Q_ASSERT(mainLoop->mainContext() == g_main_context_default());
  23. +    //Q_ASSERT(mainLoop->mainContext() == g_main_context_default());
  24.  
  25. -    // auto context = mainLoop->mainContext();
  26. +    auto context = mainLoop->mainContext();
  27. +    if(context != g_main_context_default())
  28. +        g_main_context_push_thread_default(context);
  29.      d->_platform = new PlatformDeviceMonitor;
  30.      d->_monitor  = gst_device_monitor_new();
  31.  
  32. @@ -324,6 +326,7 @@ DeviceMonitor::DeviceMonitor(GstMainLoop *mainLoop) : d(new Private(this))
  33.      if (!gst_device_monitor_start(d->_monitor)) {
  34.          qWarning("failed to start device monitor");
  35.      }
  36. +    g_main_context_pop_thread_default(context);
  37.  }
  38.  
  39.  DeviceMonitor::~DeviceMonitor()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement