Update of /cvsroot/xine/xine-lib/src/input
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14473/input

Modified Files:
        input_rtsp.c 
Log Message:
Partially implemented RTSP seekability:
  support starting the playback at an optional time by delaying the PLAY
  request upon the first call to rtsp_session_read() and setting the playback
  start time via input_plugin->seek_time().



Index: input_rtsp.c
===================================================================
RCS file: /cvsroot/xine/xine-lib/src/input/input_rtsp.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- input_rtsp.c        10 Jul 2006 22:08:16 -0000      1.24
+++ input_rtsp.c        18 Dec 2006 21:31:47 -0000      1.25
@@ -134,6 +134,18 @@
   return this->curpos;
 }
 
+static off_t rtsp_plugin_seek_time (input_plugin_t *this_gen, int time_offset, 
int origin) {
+
+  rtsp_input_plugin_t *this = (rtsp_input_plugin_t *) this_gen;
+
+  lprintf ("seek_time %d msec, origin %d\n", time_offset, origin);
+  
+  if (origin == SEEK_SET)
+    rtsp_session_set_start_time (this->rtsp, time_offset);
+    
+  return this->curpos;
+}
+
 static off_t rtsp_plugin_get_length (input_plugin_t *this_gen) {
 
   /*
@@ -145,7 +157,7 @@
 }
 
 static uint32_t rtsp_plugin_get_capabilities (input_plugin_t *this_gen) {
-  return INPUT_CAP_PREVIEW | INPUT_CAP_RIP_FORBIDDEN;
+  return INPUT_CAP_PREVIEW | INPUT_CAP_RIP_FORBIDDEN | INPUT_CAP_NOCACHE;
 }
 
 static uint32_t rtsp_plugin_get_blocksize (input_plugin_t *this_gen) {
@@ -212,7 +224,7 @@
 
   lprintf ("trying to open '%s'\n", this->mrl);
 
-  rtsp = rtsp_session_start(this->stream,this->mrl);
+  rtsp = rtsp_session_start(this->stream, this->mrl);
 
   if (!rtsp) {
     lprintf ("returning null.\n");
@@ -226,22 +238,19 @@
 }
 
 static input_plugin_t *rtsp_class_get_instance (input_class_t *cls_gen, 
xine_stream_t *stream, 
-                                   const char *data) {
+                                   const char *mrl) {
 
   /* rtsp_input_class_t  *cls = (rtsp_input_class_t *) cls_gen; */
   rtsp_input_plugin_t *this;
-  char                *mrl = strdup(data);
 
-  if (strncasecmp (mrl, "rtsp://", 6)) {
-    free (mrl);
+  if (strncasecmp (mrl, "rtsp://", 6))
     return NULL;
-  }
 
   this = (rtsp_input_plugin_t *) xine_xmalloc (sizeof (rtsp_input_plugin_t));
 
   this->stream  = stream;
   this->rtsp    = NULL;
-  this->mrl     = mrl;
+  this->mrl     = strdup (mrl);
   /* since we handle only real streams yet, we can savely add
    * an .rm extention to force handling by demux_real.
    */
@@ -255,6 +264,7 @@
   this->input_plugin.read              = rtsp_plugin_read;
   this->input_plugin.read_block        = rtsp_plugin_read_block;
   this->input_plugin.seek              = rtsp_plugin_seek;
+  this->input_plugin.seek_time         = rtsp_plugin_seek_time;
   this->input_plugin.get_current_pos   = rtsp_plugin_get_current_pos;
   this->input_plugin.get_length        = rtsp_plugin_get_length;
   this->input_plugin.get_blocksize     = rtsp_plugin_get_blocksize;


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Xine-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xine-cvslog

Reply via email to