Update of /cvsroot/xine/xine-plugin/src
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv12099

Modified Files:
        plugin.c 
Log Message:
Support the "CurrentPosition" plugin parameter.


Index: plugin.c
===================================================================
RCS file: /cvsroot/xine/xine-plugin/src/plugin.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- plugin.c    18 Dec 2006 21:39:04 -0000      1.45
+++ plugin.c    19 Dec 2006 11:18:28 -0000      1.46
@@ -82,6 +82,7 @@
   int                 w, h;
 
   int                 loop;
+  int                 start; /* start time */
 
   char                mime[32];
   
@@ -566,7 +567,7 @@
         }
         else if (--this->loop > 0) {
           if (this->list == this->track) {
-            xine_play (this->stream, 0, 0);
+            xine_play (this->stream, 0, this->track->start);
           } 
           else {
             playback_stop (this);
@@ -664,7 +665,10 @@
       log ("xine_stream_new() failed!");
       return NPERR_OUT_OF_MEMORY_ERROR;
     }
-    xine_gui_send_vo_data (this->stream, XINE_GUI_SEND_EXPOSE_EVENT, NULL);
+    xine_gui_send_vo_data (this->stream, 
+                           XINE_GUI_SEND_DRAWABLE_CHANGED, (void 
*)this->window);
+    xine_gui_send_vo_data (this->stream,
+                           XINE_GUI_SEND_VIDEOWIN_VISIBLE, (void *) 1);
     /* Load xine logo. */
     if (xine_open (this->stream, LOGO_PATH))
       xine_play (this->stream, 0, 0);
@@ -723,7 +727,7 @@
   return buf;
 }
 
-NPError NPP_GetValue (NPP instance, NPPVariable variable, void *value) {
+NPError NPP_GetValue (void *instance, NPPVariable variable, void *value) {
   log ("NPP_GetValue( variable=%d )", variable);
 
   switch (variable) {
@@ -771,6 +775,7 @@
   pthread_mutexattr_t  attr;
   char                *mrl = NULL;
   int                  loop = 1;
+  int                  start = 0;
   char                *demux;
   int                  i;
 
@@ -794,6 +799,9 @@
              !strcasecmp (argn[i], "playcount")) {
       loop = atoi (argv[i]);
     }
+    else if (!strcasecmp (argn[i], "currentposition")) {
+      start = atoi (argv[i]) * 1000;
+    }
     else if (!strcasecmp (argn[i], "controls")) {
       /* Ignore Real Player control panels. */
       if (strcasecmp (argv[i], "ImageWindow"))
@@ -815,6 +823,7 @@
 
   this->instance = instance;
   this->loop = loop;
+  this->start = start;
 
   this->xine = xine_create ();
   if (!this->xine) {
@@ -839,7 +848,7 @@
     snprintf (this->demux, sizeof(this->demux), "%s", demux);
 
   if (mrl && *mrl)
-    this->track = playlist_insert (&this->list, mrl, 0);
+    this->track = playlist_insert (&this->list, mrl, this->start);
 
   pthread_mutexattr_init (&attr);
   pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
@@ -1006,7 +1015,7 @@
     *(tmp+1) = '\0';
   
   playlist_free (&this->list);
-  this->track = playlist_insert (&this->list, stream->url, 0);
+  this->track = playlist_insert (&this->list, stream->url, this->start);
 
   playback_start (this);
 


-------------------------------------------------------------------------
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
Xine-cvslog@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xine-cvslog

Reply via email to