]> git.sesse.net Git - vlc/commitdiff
Fix Range handling
authorRémi Denis-Courmont <rem@videolan.org>
Wed, 7 May 2008 16:38:48 +0000 (19:38 +0300)
committerRémi Denis-Courmont <rem@videolan.org>
Wed, 7 May 2008 16:38:48 +0000 (19:38 +0300)
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.

modules/stream_out/rtsp.c

index 500c7c5c79c820938a6e0e8a9b07574a4d43a96a..0db208c68fc9561f1b4e0985fc924b3a6cf980db 100644 (file)
@@ -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;