Skip to content

Commit f840d6d

Browse files
committed
Stopping video playback when opening a project, trying to simplify some edge cases (no need for continous playback during switching project files, lol)
1 parent 2ebef94 commit f840d6d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/windows/main_window.py

+6
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,12 @@ def open_project(self, file_path, clear_thumbnails=True):
486486
# Ignore the request
487487
return
488488

489+
# Stop preview thread
490+
self.SpeedSignal.emit(0)
491+
ui_util.setup_icon(self, self.actionPlay, "actionPlay", "media-playback-start")
492+
self.actionPlay.setChecked(False)
493+
QCoreApplication.processEvents()
494+
489495
# Do we have unsaved changes?
490496
if app.project.needs_save():
491497
ret = QMessageBox.question(self, _("Unsaved Changes"), _("Save changes to project first?"), QMessageBox.Cancel | QMessageBox.No | QMessageBox.Yes)

src/windows/video_widget.py

-4
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ def changed(self, action):
4646
display_ratio_changed = False
4747
pixel_ratio_changed = False
4848
if action.key and action.key[0] in ["display_ratio", "pixel_ratio"] or action.type in ["load"]:
49-
self.mutex.lock()
50-
5149
# Update display ratio (if found)
5250
if action.type == "load" and action.values.get("display_ratio"):
5351
display_ratio_changed = True
@@ -72,8 +70,6 @@ def changed(self, action):
7270
if display_ratio_changed or pixel_ratio_changed:
7371
get_app().window.timeline_sync.timeline.SetMaxSize(round(self.width() * self.pixel_ratio.ToFloat()), round(self.height() * self.pixel_ratio.ToFloat()))
7472

75-
self.mutex.unlock()
76-
7773
def paintEvent(self, event, *args):
7874
""" Custom paint event """
7975
self.mutex.lock()

0 commit comments

Comments
 (0)