Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37043081
en ru br
Репозитории ALT
S:3.0.0-alt7.beta1.gitc5b1766
www.altlinux.org/Changes

Группа :: Система/Ядро и оборудование
Пакет: howdy

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: howdy-pull-692-1.patch
Скачать


From fb8c1daf94dc427084730dee73ac2d828b9d1b76 Mon Sep 17 00:00:00 2001
From: FeliciaWen <wmyfelix@gmail.com>
Date: Tue, 26 Jul 2022 11:58:17 +0800
Subject: [PATCH] Try 4 times more if can't read a frame.
---
 howdy/src/recorders/video_capture.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
 mode change 100644 => 100755 howdy/src/recorders/video_capture.py
diff --git a/howdy/src/recorders/video_capture.py b/howdy/src/recorders/video_capture.py
old mode 100644
new mode 100755
index 50032ad3..07c43204
--- a/howdy/src/recorders/video_capture.py
+++ b/howdy/src/recorders/video_capture.py
@@ -81,10 +81,13 @@ def read_frame(self):
 		# Grab a single frame of video
 		# Don't remove ret, it doesn't work without it
 		ret, frame = self.internal.read()
-		if not ret:
-			print(_("Failed to read camera specified in the 'device_path' config option, aborting"))
-			sys.exit(1)
-
+		i = 0
+		while not ret and i<=4:
+			ret, frame = self.internal.read()
+			if i == 4:
+				print(_("Failed to read camera specified in the 'device_path' config option, aborting"))
+				sys.exit(1)
+			i+=1
 		try:
 			# Convert from color to grayscale
 			# First processing of frame, so frame errors show up here
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin