[vlc-devel] commit: RTP sout: fix buffer size for SRTP ( Rémi Denis-Courmont )

git version control git at videolan.org
Sun Jun 15 21:39:25 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sun Jun 15 22:41:04 2008 +0300| [e1f0919720c9ba214ce800146a3155e3924ce7d5]

RTP sout: fix buffer size for SRTP

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e1f0919720c9ba214ce800146a3155e3924ce7d5
---

 modules/stream_out/rtp.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c
index c74f659..d094193 100644
--- a/modules/stream_out/rtp.c
+++ b/modules/stream_out/rtp.c
@@ -945,6 +945,7 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
             msg_Err (p_stream, "bad SRTP key/salt combination (%m)");
             goto error;
         }
+        id->i_sequence = 0; /* FIXME: awful hack for libvlc_srtp */
     }
 
     vlc_mutex_init( &id->lock_sink );
@@ -1440,16 +1441,10 @@ static void ThreadSend( vlc_object_t *p_this )
         if( id->srtp )
         {   /* FIXME: this is awfully inefficient */
             size_t len = out->i_buffer;
-            int val = srtp_send( id->srtp, out->p_buffer, &len,
-                                out->i_buffer );
-            if( val == ENOSPC )
-            {
-                out = block_Realloc( out, 0, len );
-                if( out == NULL )
-                    continue;
-                val = srtp_send( id->srtp, out->p_buffer, &len,
-                                 out->i_buffer );
-            }
+            out = block_Realloc( out, 0, len + 10 );
+            out->i_buffer = len;
+
+            int val = srtp_send( id->srtp, out->p_buffer, &len, len + 10 );
             if( val )
             {
                 errno = val;




More information about the vlc-devel mailing list