[vlma-devel] commit: Satellite and DTT orders were not built correctly. (Adrien Grand )

git version control git at videolan.org
Mon Sep 8 23:15:59 CEST 2008


vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Mon Sep  8 23:04:07 2008 +0200| [6c8cb3e8420cd43404c8495f7f527b8dcf9f18b8] | committer: Adrien Grand 

Satellite and DTT orders were not built correctly.

Bug introduced in 0eec6492e24ed94161ead30660175a871ba7d242.

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

 .../org/videolan/vlma/order/SatOrderSender.java    |   14 ++++++++------
 .../org/videolan/vlma/order/TNTOrderSender.java    |   15 ++++++++-------
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/vlma-core/src/main/java/org/videolan/vlma/order/SatOrderSender.java b/vlma-core/src/main/java/org/videolan/vlma/order/SatOrderSender.java
index c7f099b..6a42128 100644
--- a/vlma-core/src/main/java/org/videolan/vlma/order/SatOrderSender.java
+++ b/vlma-core/src/main/java/org/videolan/vlma/order/SatOrderSender.java
@@ -56,13 +56,17 @@ public class SatOrderSender extends OrderSender {
 
             StringBuilder ids = new StringBuilder();
             StringBuilder command = new StringBuilder();
+            command.append("setup ")
+                   .append(getVLMCommandName(o))
+                   .append(" output #duplicate{");
+            boolean firstLoop = true;
             for (Media m : o.getMedias()) {
                 ch = (SatChannel) m;
-                if (ids.length() > 0) {
+                if (!firstLoop) {
                     ids.append(",");
                 }
                 ids.append(ch.getSid());
-                if (command.length() > 0) {
+                if (!firstLoop) {
                     command.append(",");
                 }
                 command.append(String.format("dst=standard{mux=%s,access=%s,dst=%s",
@@ -72,14 +76,12 @@ public class SatOrderSender extends OrderSender {
                             ch.getProgram().getSapName(), ch.getProgram().getSapGroup()));
                 }
                 command.append(String.format("},select=\"program=%d\"", ch.getSid()));
+                firstLoop = false;
             }
             // Orders to stream the channels
             telnetCommand("setup " + getVLMCommandName(o)
                     + " option programs=" + ids, o.getAdapter());
-            command.append("setup " + getVLMCommandName(o))
-                    .append(" output #duplicate{")
-                    .append(command)
-                    .append("}");
+            command.append("}");
             telnetCommand(command.toString(), o.getAdapter());
             telnetCommand("setup " + getVLMCommandName(o) + " enabled", o.getAdapter());
             telnetCommand("control " + getVLMCommandName(o) + " play", o.getAdapter());
diff --git a/vlma-core/src/main/java/org/videolan/vlma/order/TNTOrderSender.java b/vlma-core/src/main/java/org/videolan/vlma/order/TNTOrderSender.java
index f5e0da0..d282817 100644
--- a/vlma-core/src/main/java/org/videolan/vlma/order/TNTOrderSender.java
+++ b/vlma-core/src/main/java/org/videolan/vlma/order/TNTOrderSender.java
@@ -46,13 +46,17 @@ public class TNTOrderSender extends OrderSender {
                     o.getAdapter());
             StringBuilder ids = new StringBuilder();
             StringBuilder command = new StringBuilder();
+            command.append("setup ")
+                .append(getVLMCommandName(o))
+                .append(" output #duplicate{");
+            boolean firstLoop = true;
             for (Media m : o.getMedias()) {
                 ch = (TNTChannel) m;
-                if (ids.length() > 0) {
+                if (!firstLoop) {
                     ids.append(",");
                 }
                 ids.append(ch.getSid());
-                if (command.length() > 0) {
+                if (!firstLoop) {
                     command.append(",");
                 }
                 command.append(String.format("dst=standard{mux=%s,access=%s,dst=%s",
@@ -62,15 +66,12 @@ public class TNTOrderSender extends OrderSender {
                             ch.getProgram().getSapName(), ch.getProgram().getSapGroup()));
                 }
                 command.append(String.format("},select=\"program=%d\"", ch.getSid()));
+                firstLoop = false;
             }
             // Orders to stream the channels
             telnetCommand("setup " + getVLMCommandName(o)
                     + " option programs=" + ids, o.getAdapter());
-            command.append("setup ")
-                    .append(getVLMCommandName(o))
-                    .append(" output #duplicate{")
-                    .append(command)
-                    .append("}");
+            command.append("}");
             telnetCommand(command.toString(), o.getAdapter());
             telnetCommand("setup " + getVLMCommandName(o) + " enabled", o.getAdapter());
             telnetCommand("control " + getVLMCommandName(o) + " play", o.getAdapter());



More information about the vlma-devel mailing list