[vlma-devel] commit: Only update broadcasteState when checking orders execution. ( Adrien Grand )

git version control git at videolan.org
Mon Nov 10 18:45:46 CET 2008


vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Mon Nov 10 15:32:31 2008 +0100| [b79335e8f1ffd3abef022daccaff3a80b5c55789] | committer: Adrien Grand 

Only update broadcasteState when checking orders execution.

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

 .../org/videolan/vlma/monitor/OrderMonitor.java    |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/vlma-core/src/main/java/org/videolan/vlma/monitor/OrderMonitor.java b/vlma-core/src/main/java/org/videolan/vlma/monitor/OrderMonitor.java
index 95655eb..be55b28 100644
--- a/vlma-core/src/main/java/org/videolan/vlma/monitor/OrderMonitor.java
+++ b/vlma-core/src/main/java/org/videolan/vlma/monitor/OrderMonitor.java
@@ -82,8 +82,6 @@ public class OrderMonitor implements Monitor {
             if (program != null && program.isTimeToPlay()) {
                 if (!streamWatcher.isPlayed(media)) {
                     logger.info("Program " + program.getSapName() + " is currently not played.");
-                    program.setPlayer(null);
-                    program.setAdapterName(null);
                     program.setBroadcastState(false);
                     result.add(media);
                 } else {
@@ -130,7 +128,12 @@ public class OrderMonitor implements Monitor {
                 Set<Order> orders = vlmaService.getOrders();
                 synchronized (orders) {
                     for(Media media : notPlayedMedias) {
-                    Iterator<Order> it = orders.iterator();
+                        Program program = media.getProgram();
+                        if(program != null) {
+                            program.setPlayer(null);
+                            program.setAdapterName(null);
+                        }
+                        Iterator<Order> it = orders.iterator();
                         while (it.hasNext()) {
                             Order o = it.next();
                             if(o.getMedias().contains(media)) {



More information about the vlma-devel mailing list