[vlc-commits] commit: rtsp: handle SETUP requests on already set up tracks (Pierre Ynard )

git at videolan.org git at videolan.org
Sun Dec 12 09:25:31 CET 2010


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sun Dec 12 09:24:41 2010 +0100| [693b28be24593883f5c28a0615685fa12888d41a] | committer: Pierre Ynard 

rtsp: handle SETUP requests on already set up tracks

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

 modules/stream_out/rtsp.c |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/modules/stream_out/rtsp.c b/modules/stream_out/rtsp.c
index dcefe7c..c463746 100644
--- a/modules/stream_out/rtsp.c
+++ b/modules/stream_out/rtsp.c
@@ -823,8 +823,6 @@ static int RtspHandler( rtsp_stream_t *rtsp, rtsp_stream_id_t *id,
                     }
                     else
                     {
-                        /* FIXME: we probably need to remove an access out,
-                         * if there is already one for the same ID */
                         ses = RtspClientGet( rtsp, psz_session );
                         if( ses == NULL )
                         {
@@ -836,6 +834,26 @@ static int RtspHandler( rtsp_stream_t *rtsp, rtsp_stream_id_t *id,
                     }
                     RtspClientAlive(ses);
 
+                    /* Bail if the track is already set up: we don't
+                     * support changing the transport parameters on the
+                     * fly */
+                    bool setup = false;
+                    for (int i = 0; i < ses->trackc; i++)
+                    {
+                        if (ses->trackv[i].id == id)
+                        {
+                            setup = true;
+                            break;
+                        }
+                    }
+                    if (setup)
+                    {
+                        vlc_mutex_unlock( &rtsp->lock );
+                        answer->i_status = 455;
+                        net_Close( fd );
+                        break;
+                    }
+
                     INSERT_ELEM( ses->trackv, ses->trackc, ses->trackc,
                                  track );
                     vlc_mutex_unlock( &rtsp->lock );



More information about the vlc-commits mailing list