Parcourir la source

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

Zachary Kotlarek il y a 13 ans
Parent
commit
af44e2aabd
1 fichiers modifiés avec 4 ajouts et 16 suppressions
  1. 4 16
      dmx/rifftrax.pl

+ 4 - 16
dmx/rifftrax.pl

@@ -209,12 +209,11 @@ while (1) {
 		rename($tmp, $OUTPUT_FILE);
 		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();
 			pauseRiff();
-		} elsif ($state eq 'PLAY' && !$playing) {
+		} elsif ($exists{'PLAYING'} && !$playing) {
 			playRiff();
 			playRiff();
 		}
 		}
 	}
 	}
@@ -301,17 +300,6 @@ while (1) {
 					}
 					}
 					setRiffRate($newRate);
 					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 {
 		} else {