]> git.sesse.net Git - vlc/commitdiff
* split up hostname and following path and insert the port after the hostname (fixes...
authorFelix Paul Kühne <fkuehne@videolan.org>
Sun, 18 Sep 2005 19:29:35 +0000 (19:29 +0000)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sun, 18 Sep 2005 19:29:35 +0000 (19:29 +0000)
modules/gui/macosx/output.m

index 6749d84a95df7fd90f9aa899203e130507d2dd25..bd50781160f25bd6dbc6b912e138f34eb783dc9d 100644 (file)
         }
         if ( ![o_mode isEqualToString: @"RTP"] )
         {
-
+            /* split up the hostname and the following path to paste the
+             * port correctly. Not need, if there isn't any path following the
+             * hostname. */
+            NSArray * o_urlItems = [[o_stream_address stringValue] \
+                componentsSeparatedByString: @"/"];
+            NSMutableString * o_finalStreamAddress;
+            o_finalStreamAddress = [[NSMutableString alloc] init];
+            
+            if ([o_urlItems count] == 1)
+            {
+                [o_finalStreamAddress appendFormat: @"\"%@:%@\"", \
+                    [o_stream_address stringValue],[o_stream_port stringValue]];
+            }
+            else
+            {
+                [o_finalStreamAddress appendFormat: @"\"%@:%@", [o_urlItems \
+                    objectAtIndex: 0], [o_stream_port stringValue]];
+                unsigned int x;
+                x = 1;
+                while (x != [o_urlItems count])
+                {
+                    [o_finalStreamAddress appendFormat: @"/%@", [o_urlItems \
+                        objectAtIndex: x]];
+                    x = (x + 1);
+                }
+                [o_finalStreamAddress appendString: @"\""];
+            }
+            
             [o_mrl_string appendFormat:
-                        @"std{access=%@,mux=%@,url=\"%@:%@\"%@}",
-                        o_mode, o_mux_string, [o_stream_address stringValue],
-                        [o_stream_port stringValue], o_announce];
+                        @"std{access=%@,mux=%@,url=%@%@}",
+                        o_mode, o_mux_string, o_finalStreamAddress, o_announce];
         }
         else
         {