totem r5159 - in trunk: . browser-plugin



Author: hadess
Date: Thu Feb 21 01:51:36 2008
New Revision: 5159
URL: http://svn.gnome.org/viewvc/totem?rev=5159&view=rev

Log:
2008-02-21  Bastien Nocera  <hadess hadess net>

	* browser-plugin/totemNarrowSpacePlugin.cpp:
	* browser-plugin/totemPlugin.cpp:
	* browser-plugin/totemPlugin.h:
	Revert the previous commit, it's broken



Modified:
   trunk/ChangeLog
   trunk/browser-plugin/totemNarrowSpacePlugin.cpp
   trunk/browser-plugin/totemPlugin.cpp
   trunk/browser-plugin/totemPlugin.h

Modified: trunk/browser-plugin/totemNarrowSpacePlugin.cpp
==============================================================================
--- trunk/browser-plugin/totemNarrowSpacePlugin.cpp	(original)
+++ trunk/browser-plugin/totemNarrowSpacePlugin.cpp	Thu Feb 21 01:51:36 2008
@@ -860,8 +860,6 @@
 {
   TOTEM_SCRIPTABLE_LOG_ACCESS ();
 
-  NS_ENSURE_STATE (IsValid ());
-
   *_retval = mPlugin->mTime;
   return NS_OK;
 }
@@ -870,16 +868,9 @@
 NS_IMETHODIMP
 totemScriptablePlugin::SetTime(PRUint32 time)
 {
-  NPByteRange byterange;
-
-  TOTEM_SCRIPTABLE_LOG_ACCESS ();
-
-  NS_ENSURE_STATE (IsValid ());
-
-  if (mPlugin->mTime <= 0)
-    return NS_ERROR_NOT_AVAILABLE;
+  TOTEM_SCRIPTABLE_WARN_UNIMPLEMENTED();
 
-  return mPlugin->RequestRead (time * mPlugin->mBytesLength / mPlugin->mTime);
+  return NS_OK;
 }
 
 /* unsigned long GetTimeScale (); */

Modified: trunk/browser-plugin/totemPlugin.cpp
==============================================================================
--- trunk/browser-plugin/totemPlugin.cpp	(original)
+++ trunk/browser-plugin/totemPlugin.cpp	Thu Feb 21 01:51:36 2008
@@ -2085,7 +2085,7 @@
 	if (!stream || !stream->url)
 		return NPERR_GENERIC_ERROR;
 
-	D ("NewStream mimetype '%s' URL '%s' seekable '%s'", (const char *) type, stream->url, seekable ? "TRUE" : "FALSE");
+	D ("NewStream mimetype '%s' URL '%s'", (const char *) type, stream->url);
 
 	/* We already have a live stream */
 	if (mStream) {
@@ -2143,9 +2143,6 @@
 	if (g_str_has_prefix (stream->url, "file://")) {
 		*stype = NP_ASFILEONLY;
 		mStreamType = NP_ASFILEONLY;
-	} else if (seekable) {
-		*stype = NP_SEEK;
-		mStreamType = NP_SEEK;
 	} else {
 		*stype = NP_ASFILE;
 		mStreamType = NP_ASFILE;
@@ -2165,7 +2162,6 @@
 	/* To track how many data we get from ::Write */
 	mBytesStreamed = 0;
 	mBytesLength = stream->end;
-	mSeekable = seekable;
 
 	return NPERR_NO_ERROR;
 }
@@ -2182,7 +2178,6 @@
 	mStream = nsnull;
 	mBytesStreamed = 0;
 	mBytesLength = 0;
-	mSeekable = PR_FALSE;
 
 	int ret = close (mViewerFD);
 	if (ret < 0) {
@@ -2195,30 +2190,6 @@
 	return NPERR_NO_ERROR;
 }
 
-nsresult
-totemPlugin::RequestRead (PRInt32 offset)
-{
-	NPByteRange range;
-
-	if (!mStream)
-		return NS_ERROR_INVALID_POINTER;
-	if (!mSeekable)
-		return NS_ERROR_NOT_AVAILABLE;
-
-	D ("RequestRead %d", offset);
-
-	range.offset = offset;
-	range.length = mBytesLength - offset;
-	range.next = NULL;
-
-	if (CallNPN_RequestReadProc (sNPN.requestread,
-				     mStream,
-				     &range) == NPERR_NO_ERROR)
-		return NPERR_NO_ERROR;
-
-	return NPERR_GENERIC_ERROR;
-}
-
 int32
 totemPlugin::WriteReady (NPStream *stream)
 {
@@ -2309,7 +2280,7 @@
 	} else /* ret >= 0 */ {
 		DD ("Wrote %d bytes", ret);
 
-		mBytesStreamed = offset + ret;
+		mBytesStreamed += ret;
 	}
 
 	return ret;

Modified: trunk/browser-plugin/totemPlugin.h
==============================================================================
--- trunk/browser-plugin/totemPlugin.h	(original)
+++ trunk/browser-plugin/totemPlugin.h	Thu Feb 21 01:51:36 2008
@@ -87,7 +87,7 @@
                        uint16* stype);
     NPError DestroyStream (NPStream* stream,
                            NPError reason);
-    nsresult RequestRead (PRInt32 offset);
+  
     int32 WriteReady (NPStream *stream);
     int32 Write (NPStream *stream,
                 int32 offset,
@@ -193,7 +193,6 @@
   public:
     PRUint32 mBytesStreamed;
     PRUint32 mBytesLength;
-    PRBool   mSeekable;
   private:
     PRUint8 mStreamType;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]