Skip to content

Commit

Permalink
#3964 call 'sync' before calling gstreamer
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Oct 12, 2023
1 parent 7883acc commit 9c8f85b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions xpra/gtk/configure/gstreamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

import shlex
from textwrap import wrap
from subprocess import Popen, PIPE
from subprocess import Popen, PIPE, check_call

from xpra.util.types import AtomicInteger
from xpra.os_util import is_X11, is_gnome, OSX, WIN32
from xpra.os_util import is_X11, is_gnome, OSX, WIN32, POSIX
from xpra.gtk.dialogs.base_gui_window import BaseGUIWindow
from xpra.gtk.widget import label, slabel, title_box
from xpra.platform.paths import get_image
Expand All @@ -30,6 +30,10 @@
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
""".replace("\n", "")

def sync() -> None:
if POSIX:
check_call("sync")


class ConfigureGUI(BaseGUIWindow):

Expand Down Expand Up @@ -139,7 +143,7 @@ def run_test_cmd(cmd):
log.error(f"Error running {cmd!r}: {e}")
set_label(f"Error: {e}")
return False

sync()
#first make sure that the element exists:
if not run_test_cmd(["gst-inspect-1.0", element]):
return
Expand All @@ -148,7 +152,6 @@ def run_test_cmd(cmd):
return
set_label("Test pipeline worked")


def populate_with_warning(self):
layout = Gtk.Layout()
layout.set_margin_top(0)
Expand Down Expand Up @@ -186,6 +189,7 @@ def main(_args) -> int:
from xpra.gtk.configure.main import run_gui
return run_gui(ConfigureGUI)


if __name__ == "__main__":
import sys
sys.exit(main(sys.argv[1:]))

0 comments on commit 9c8f85b

Please sign in to comment.