Browse code

Support seeking as defined by the rfc

a PLAY with Range alone while in PLAY status should be interpreted
as an enqueue
a PAUSE followed by a PLAY with Range is the proper way to ask to
seek to a point.

See rfc2326

Originally committed as revision 19143 to svn://svn.ffmpeg.org/ffmpeg/trunk

Luca Barbato authored on 2009/06/11 00:08:02
Showing 2 changed files
... ...
@@ -1599,6 +1599,9 @@ static int rtsp_read_seek(AVFormatContext *s, int stream_index,
1599 1599
     case RTSP_STATE_IDLE:
1600 1600
         break;
1601 1601
     case RTSP_STATE_PLAYING:
1602
+        if (rtsp_read_pause(s) != 0)
1603
+            return -1;
1604
+        rt->state = RTSP_STATE_SEEKING;
1602 1605
         if (rtsp_read_play(s) != 0)
1603 1606
             return -1;
1604 1607
         break;
... ...
@@ -151,6 +151,7 @@ enum RTSPClientState {
151 151
     RTSP_STATE_IDLE,    /**< not initialized */
152 152
     RTSP_STATE_PLAYING, /**< initialized and receiving data */
153 153
     RTSP_STATE_PAUSED,  /**< initialized, but not receiving data */
154
+    RTSP_STATE_SEEKING, /**< initialized, requesting a seek */
154 155
 };
155 156
 
156 157
 /**