]> git.sesse.net Git - vlc/commitdiff
* Fix searching in aggregate mode for the RTSP VoD module. (fixes #655)
authorDerk-Jan Hartman <hartman@videolan.org>
Sun, 30 Apr 2006 22:08:18 +0000 (22:08 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Sun, 30 Apr 2006 22:08:18 +0000 (22:08 +0000)
  Pausing is still broken.

modules/misc/rtsp.c

index 9353b293b2b08cbc4c22e573f85daf3645a7f107..55d624f5c13015dc900aeb6d1dfeb7c9b4d771c4 100644 (file)
@@ -780,7 +780,7 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
 
         case HTTPD_MSG_PLAY:
         {
-            char *psz_output, ip[NI_MAXNUMERICHOST];
+            char *psz_output, *psz_position, ip[NI_MAXNUMERICHOST];
             int i, i_port_audio = 0, i_port_video = 0;
 
             /* for now only multicast so easy */
@@ -799,6 +799,30 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
             p_rtsp = RtspClientGet( p_media, psz_session );
             if( !p_rtsp ) break;
 
+            if( p_rtsp->b_playing )
+            {
+                char *psz_position = httpd_MsgGet( query, "Range" );
+                if( psz_position ) psz_position = strstr( psz_position, "npt=" );
+                if( psz_position )
+                {
+                    double f_pos;
+                    char *end;
+
+                    msg_Dbg( p_vod, "seeking request: %s", psz_position );
+
+                    psz_position += 4;
+                    /* FIXME: npt= is not necessarily formatted as a float */
+                    f_pos = us_strtod( psz_position, &end );
+                    if( end > psz_position )
+                    {
+                        f_pos /= ((double)(p_media->i_length))/1000 /1000 / 100;
+                        vod_MediaControl( p_vod, p_media, psz_session,
+                                      VOD_MEDIA_SEEK, f_pos );
+                    }
+                    break;
+                }
+            }
+
             if( p_rtsp->b_playing && p_rtsp->b_paused )
             {
                 vod_MediaControl( p_vod, p_media, psz_session,