[vlma-devel] commit: Try to avoid false positives in the multicast stream watcher. ( Adrien Grand )

git version control git at videolan.org
Wed Dec 17 22:37:31 CET 2008


vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Wed Dec 17 22:35:32 2008 +0100| [5292ee41b1e6ce05566cfbb0874250fe4a55a290] | committer: Adrien Grand 

Try to avoid false positives in the multicast stream watcher.

> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=5292ee41b1e6ce05566cfbb0874250fe4a55a290
---

 .../videolan/vlma/monitor/MonitorThreadGroup.java  |    7 +++++++
 .../vlma/watcher/DirectMulticastStreamWatcher.java |    7 ++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/vlma-core/src/main/java/org/videolan/vlma/monitor/MonitorThreadGroup.java b/vlma-core/src/main/java/org/videolan/vlma/monitor/MonitorThreadGroup.java
index 572b37a..38c768f 100644
--- a/vlma-core/src/main/java/org/videolan/vlma/monitor/MonitorThreadGroup.java
+++ b/vlma-core/src/main/java/org/videolan/vlma/monitor/MonitorThreadGroup.java
@@ -26,6 +26,13 @@ import java.io.PrintWriter;
 import org.apache.log4j.Logger;
 import org.videolan.vlma.daemon.Daemon;
 
+/**
+ * Common ThreadGroup for monitors.
+ * This thread group stops the whole application when an exception is thrown
+ * and not caught.
+ *
+ * @author Adrien Grand
+ */
 public class MonitorThreadGroup extends ThreadGroup {
 
     private static final Logger logger = Logger.getLogger(MonitorThreadGroup.class);
diff --git a/vlma-core/src/main/java/org/videolan/vlma/watcher/DirectMulticastStreamWatcher.java b/vlma-core/src/main/java/org/videolan/vlma/watcher/DirectMulticastStreamWatcher.java
index 2d0175f..9c4b763 100644
--- a/vlma-core/src/main/java/org/videolan/vlma/watcher/DirectMulticastStreamWatcher.java
+++ b/vlma-core/src/main/java/org/videolan/vlma/watcher/DirectMulticastStreamWatcher.java
@@ -51,18 +51,18 @@ public class DirectMulticastStreamWatcher implements StreamWatcher {
     /**
      * The multicast socket timeout
      */
-    private static final int SOCKET_RECEIVE_TIMEOUT = 500;
+    private static final int SOCKET_RECEIVE_TIMEOUT = 1000;
 
     /**
      * The minimal length of the string to consider that the media is
      * broadcasted
      */
-    private static final int BUF_LENGHT_MIN = 300;
+    private static final int BUF_LENGHT_MIN = 100;
 
     /**
      * The time leaved to the multicast socket to get data.
      */
-    private static final int WAIT_SPAN = 500;
+    private static final int WAIT_SPAN = 1000;
 
     /**
      * Is true when the socket try to receive data
@@ -76,6 +76,7 @@ public class DirectMulticastStreamWatcher implements StreamWatcher {
     public synchronized boolean isPlayed(Media media) {
     	Program program = media.getProgram();
         if (program == null || program.getIp() == null) {
+            logger.warn("Checking the broadcast state of a non programmed media: " + media.getName());
             return false;
         }
 



More information about the vlma-devel mailing list