]> git.sesse.net Git - vlc/blobdiff - modules/stream_out/rtp.c
rtp sout: fix RTSP track numbering in SDP
[vlc] / modules / stream_out / rtp.c
index e20669e40abbe6261c34349c0992e19bc228d099..c9568c88376d8fbb03ca0f7b12bf06a0cb66f4e2 100644 (file)
@@ -833,11 +833,12 @@ char *SDPGenerate( const sout_stream_t *p_stream, const char *rtsp_url )
 
         if( rtsp_url != NULL )
         {
-            assert( strlen( rtsp_url ) > 0 );
-            bool addslash = ( rtsp_url[strlen( rtsp_url ) - 1] != '/' );
-            sdp_AddAttribute ( &psz_sdp, "control",
-                               addslash ? "%s/trackID=%u" : "%strackID=%u",
-                               rtsp_url, i );
+            char *track_url = RtspAppendTrackPath( id->rtsp_id, rtsp_url );
+            if( track_url != NULL )
+            {
+                sdp_AddAttribute ( &psz_sdp, "control", "%s", track_url );
+                free( track_url );
+            }
         }
         else
         {