[vlc-devel] commit: Fix Range handling ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed May 7 18:43:03 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rem at videolan.org> | Wed May  7 19:38:48 2008 +0300| [75f050b3c60cf51ca70de494b8a9e3b7f7b12e02]

Fix Range handling

In RTSP/1.0, don't return any range (as far as I understand).
In RTSP/2.0, we'd have to compute the time from the beginning.

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

 modules/stream_out/rtsp.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/modules/stream_out/rtsp.c b/modules/stream_out/rtsp.c
index 500c7c5..0db208c 100644
--- a/modules/stream_out/rtsp.c
+++ b/modules/stream_out/rtsp.c
@@ -619,6 +619,14 @@ static int RtspHandler( rtsp_stream_t *rtsp, rtsp_stream_id_t *id,
             rtsp_session_t *ses;
             answer->i_status = 200;
 
+            psz_session = httpd_MsgGet( query, "Session" );
+            const char *range = httpd_MsgGet (query, "Range");
+            if (range && strncmp (range, "npt=", 4))
+            {
+                answer->i_status = 501;
+                break;
+            }
+
             vlc_mutex_lock( &rtsp->lock );
             ses = RtspClientGet( rtsp, psz_session );
             if( ses != NULL )
@@ -652,7 +660,6 @@ static int RtspHandler( rtsp_stream_t *rtsp, rtsp_stream_id_t *id,
             }
             vlc_mutex_unlock( &rtsp->lock );
 
-            httpd_MsgAdd( answer, "Range", "npt=now-" );
             if( httpd_MsgGet( query, "Scale" ) != NULL )
                 httpd_MsgAdd( answer, "Scale", "1." );
             break;




More information about the vlc-devel mailing list