Преглед на файлове

Use PLAYING rather than the master state, to support headless displays (and more generally track the real sync state)

Zachary Kotlarek преди 13 години
родител
ревизия
af44e2aabd
променени са 1 файла, в които са добавени 4 реда и са изтрити 16 реда
  1. 4 16
      dmx/rifftrax.pl

+ 4 - 16
dmx/rifftrax.pl

@@ -209,12 +209,11 @@ while (1) {
 		rename($tmp, $OUTPUT_FILE);
 	}
 
-	# Play/pause to match the video
-	# This assumes our local state is valid. We double-check that state tracking if the sync error is large enough to trigger a jump
-	if ($riff) {
-		if ($state eq 'PAUSE' && $playing) {
+	# Play/pause to match the video state
+	if ($riff && exists($exists{'PLAYING'})) {
+		if (!$exists{'PLAYING'} && $playing) {
 			pauseRiff();
-		} elsif ($state eq 'PLAY' && !$playing) {
+		} elsif ($exists{'PLAYING'} && !$playing) {
 			playRiff();
 		}
 	}
@@ -301,17 +300,6 @@ while (1) {
 					}
 					setRiffRate($newRate);
 				}
-
-				# Play/pause as needed, before we adjust
-				# The state-change detection should handle most of this
-				# But double-check while adjusting in case things get out-of-sync
-				if (exists($exists{'PLAYING'})) {
-					if ($exists{'PLAYING'} && !$playing) {
-						playRiff();
-					} elsif (!$exists{'PLAYING'} && $playing) {
-						pauseRiff();
-					}
-				}
 			}
 		} else {