]> git.sesse.net Git - vlc/commitdiff
SDP: fix ordering of b= and a=
authorRémi Denis-Courmont <rem@videolan.org>
Mon, 9 Apr 2007 15:15:02 +0000 (15:15 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Mon, 9 Apr 2007 15:15:02 +0000 (15:15 +0000)
modules/stream_out/rtp.c

index cfe35e0d9425503e93bd1f6c6d1f1cdc70e88792..dee1aeca83cbfebd596b531bcbbd279c7ab05f05 100644 (file)
@@ -792,6 +792,10 @@ static char *SDPGenerate( const sout_stream_t *p_stream,
         sout_stream_id_t *id = p_sys->es[i];
 
         i_size += strlen( "m=**d*o * RTP/AVP *\r\n" ) + 10 + 10;
+        if ( id->i_bitrate )
+        {
+            i_size += strlen( "b=AS: *\r\n") + 10;
+        }
         if( id->psz_rtpmap )
         {
             i_size += strlen( "a=rtpmap:* *\r\n" ) + strlen( id->psz_rtpmap )+10;
@@ -800,10 +804,6 @@ static char *SDPGenerate( const sout_stream_t *p_stream,
         {
             i_size += strlen( "a=fmtp:* *\r\n" ) + strlen( id->psz_fmtp ) + 10;
         }
-        if ( id->i_bitrate)
-        {
-            i_size += strlen( "b=AS: *\r\n") + 10;
-        }
         if( b_rtsp )
         {
             i_size += strlen( "a=control:*/trackID=*\r\n" ) + strlen( p_sys->psz_rtsp_control ) + 10;
@@ -861,6 +861,10 @@ static char *SDPGenerate( const sout_stream_t *p_stream,
         {
             continue;
         }
+        if ( id->i_bitrate )
+        {
+            p += sprintf(p,"b=AS:%d\r\n",id->i_bitrate);
+        }
         if( id->psz_rtpmap )
         {
             p += sprintf( p, "a=rtpmap:%d %s\r\n", id->i_payload_type,
@@ -871,10 +875,6 @@ static char *SDPGenerate( const sout_stream_t *p_stream,
             p += sprintf( p, "a=fmtp:%d %s\r\n", id->i_payload_type,
                           id->psz_fmtp );
         }
-        if ( id->i_bitrate)
-        {
-            p += sprintf(p,"b=AS:%d\r\n",id->i_bitrate);
-        }
         if( b_rtsp )
         {
             p += sprintf( p, "a=control:/trackID=%d\r\n", i );