[vlma-devel] commit: Fix program management. (Adrien Grand )

git version control git at videolan.org
Sun Jun 29 16:42:01 CEST 2008


vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Sun Jun 29 16:02:24 2008 +0200| [11d97cd1d0b4dfac3e502130103d346d1b39a34f]

Fix program management.

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

 .../java/org/videolan/vlma/VLMaServiceImpl.java    |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/vlma-core/src/main/java/org/videolan/vlma/VLMaServiceImpl.java b/vlma-core/src/main/java/org/videolan/vlma/VLMaServiceImpl.java
index f4243e2..c04e0ec 100644
--- a/vlma-core/src/main/java/org/videolan/vlma/VLMaServiceImpl.java
+++ b/vlma-core/src/main/java/org/videolan/vlma/VLMaServiceImpl.java
@@ -430,9 +430,11 @@ public class VLMaServiceImpl implements VLMaService {
             Program program) throws MediaDoesNotExistException {
         Media m = this.getMedia(media);
         if (m.getProgram().getStreamingStrategy().getProtocol().equals(StreamingStrategy.Protocol.UDP)
-                && !program.getStreamingStrategy().getProtocol().equals(StreamingStrategy.Protocol.UDP)) {
+                && (program == null
+                        || !program.getStreamingStrategy().getProtocol().equals(StreamingStrategy.Protocol.UDP))) {
             ipBank.releaseIp(m.getProgram().getIp());
-        } else if (!m.getProgram().getStreamingStrategy().getProtocol().equals(StreamingStrategy.Protocol.UDP)
+        } else if (program != null
+                && !m.getProgram().getStreamingStrategy().getProtocol().equals(StreamingStrategy.Protocol.UDP)
                 && program.getStreamingStrategy().getProtocol().equals(StreamingStrategy.Protocol.UDP)) {
             program.setIp(ipBank.getIp());
         }
@@ -445,7 +447,7 @@ public class VLMaServiceImpl implements VLMaService {
             throws MediaDoesNotExistException {
         Media m = this.getMedia(media);
         Program program = programFactory.getProgram();
-        if (program.getStreamingStrategy().equals(StreamingStrategy.Protocol.UDP)) {
+        if (program.getStreamingStrategy().getProtocol().equals(StreamingStrategy.Protocol.UDP)) {
             InetAddress a = ipBank.getIp();
             logger.log(Level.DEBUG, "Multicast IPv4 address for " + m.getName() + ": " + a.toString());
             program.setIp(a);



More information about the vlma-devel mailing list