gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/asobj/NetConnection.cpp ...


From: Bastiaan Jacques
Subject: [Gnash-commit] gnash ChangeLog server/asobj/NetConnection.cpp ...
Date: Fri, 01 Jun 2007 23:36:49 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Bastiaan Jacques <bjacques>     07/06/01 23:36:48

Modified files:
        .              : ChangeLog 
        server/asobj   : NetConnection.cpp NetConnection.h 
                         NetStreamFfmpeg.cpp 

Log message:
                * server/asobj/NetConnection.{cpp,h}: Permit openConnection
                to be called more than once with the same URL.
                * server/asobj/NetStreamFfmpeg.cpp: Call detach_aux_streamer
                with a valid owner argument, so something will actually
                happen. Make sure that the NetConnection position is 0
                just in case openConnection was called before. Fix a deadlock
                by avoiding calls to the sound handler in startPlayback().
                This is cheating, but fixes bug #20036.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3438&r2=1.3439
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetConnection.cpp?cvsroot=gnash&r1=1.47&r2=1.48
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetConnection.h?cvsroot=gnash&r1=1.33&r2=1.34
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStreamFfmpeg.cpp?cvsroot=gnash&r1=1.81&r2=1.82

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3438
retrieving revision 1.3439
diff -u -b -r1.3438 -r1.3439
--- ChangeLog   1 Jun 2007 17:54:52 -0000       1.3438
+++ ChangeLog   1 Jun 2007 23:36:48 -0000       1.3439
@@ -1,3 +1,14 @@
+2007-06-02 Bastiaan Jacques <address@hidden>
+
+       * server/asobj/NetConnection.{cpp,h}: Permit openConnection 
+       to be called more than once with the same URL.
+       * server/asobj/NetStreamFfmpeg.cpp: Call detach_aux_streamer
+       with a valid owner argument, so something will actually
+       happen. Make sure that the NetConnection position is 0
+       just in case openConnection was called before. Fix a deadlock
+       by avoiding calls to the sound handler in startPlayback().
+       This is cheating, but fixes bug #20036.
+
 2007-06-01 Bastiaan Jacques <address@hidden>
 
        * macros/ffmpeg.m4: Avoid using libswscale with broken ffmpeg

Index: server/asobj/NetConnection.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetConnection.cpp,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -b -r1.47 -r1.48
--- server/asobj/NetConnection.cpp      30 May 2007 12:18:49 -0000      1.47
+++ server/asobj/NetConnection.cpp      1 Jun 2007 23:36:48 -0000       1.48
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: NetConnection.cpp,v 1.47 2007/05/30 12:18:49 strk Exp $ */
+/* $Id: NetConnection.cpp,v 1.48 2007/06/01 23:36:48 bjacques Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -52,7 +52,6 @@
 NetConnection::NetConnection()
        :
        as_object(getNetConnectionInterface()),
-       _url(),
        _loader()
 {
        attachProperties();
@@ -69,37 +68,45 @@
        // if already running there is no need to setup things again
        if (_loader.get())
        {
-               log_error("NetConnection::openConnection() called when already 
connected to a stream. Should we close the old stream and open a new one?.");
-               return false;
+               log_debug("NetConnection::openConnection() called when already 
connected to a stream. Checking if the existing connection can be used.");
+               std::string newurl;
+               if (_prefixUrl.size() > 0) {
+                       newurl += _prefixUrl + "/" + url;
+               } else {
+                       newurl += url;
+               }
+               if (newurl.compare(_completeUrl) == 0) return true;
+               else return false;
        }
 
-       if (_url.size() > 0) {
-               _url += "/";
+       if (_prefixUrl.size() > 0) {
+               _completeUrl += _prefixUrl + "/" + url;
+       } else {
+               _completeUrl += url;
        }
-       _url += url;
 
-       URL uri(_url, get_base_url());
+       URL uri(_completeUrl, get_base_url());
 
-       _url = uri.str();
-       assert(_url.find("://")!=string::npos);
+       std::string uriStr(uri.str());
+       assert(uriStr.find("://")!=string::npos);
 
        // Check if we're allowed to open url
        if (!URLAccessManager::allow(uri)) {
-               log_security(_("Gnash is not allowed to open this url: %s"), 
_url.c_str());
+               log_security(_("Gnash is not allowed to open this url: %s"), 
uriStr.c_str());
                return false;
        }
 
-       log_msg(_("Connecting to movie: %s"), _url.c_str());
+       log_msg(_("Connecting to movie: %s"), uriStr.c_str());
 
        _loader.reset( new LoadThread() );
        
        if 
(!_loader->setStream(std::auto_ptr<tu_file>(StreamProvider::getDefaultInstance().getStream(uri))))
 {
-               log_error(_("Gnash could not open this url: %s"), _url.c_str());
+               log_error(_("Gnash could not open this url: %s"), 
uriStr.c_str());
                _loader.reset();
                return false;
        }
 
-       log_msg(_("Connection etablished to movie: %s"), _url.c_str());
+       log_msg(_("Connection etablished to movie: %s"), uriStr.c_str());
 
        return true;
 }
@@ -111,11 +118,11 @@
        // What is this ? It is NOT documented in the header !!
        //if (url == "null" || url == "NULL") return;
 
-       // If there already is something in _url, then we already have a url,
-       // so no need to renew it.
-       if (_url.size() > 0) return;
+       // If there already is something in _prefixUrl, then we already have a 
url,
+       // so no need to renew it. This may not correct, needs some testing.
+       if (_prefixUrl.size() > 0) return;
 
-       _url += url;
+       _prefixUrl += url;
 }
 
 /*public*/

Index: server/asobj/NetConnection.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetConnection.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- server/asobj/NetConnection.h        30 May 2007 12:18:49 -0000      1.33
+++ server/asobj/NetConnection.h        1 Jun 2007 23:36:48 -0000       1.34
@@ -15,7 +15,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: NetConnection.h,v 1.33 2007/05/30 12:18:49 strk Exp $ */
+/* $Id: NetConnection.h,v 1.34 2007/06/01 23:36:48 bjacques Exp $ */
 
 #ifndef __NETCONNECTION_H__
 #define __NETCONNECTION_H__
@@ -143,8 +143,11 @@
        /// Extend the URL to be used for playing
        void addToURL(const std::string& url);
 
-       /// the url of the file
-       std::string _url;
+       /// the url prefix optionally passed to connect()
+       std::string _prefixUrl;
+
+       /// the complete url of the file
+       std::string _completeUrl;
 
        /// the as_object which owns the connection
        boost::intrusive_ptr<as_object> _owner;

Index: server/asobj/NetStreamFfmpeg.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStreamFfmpeg.cpp,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -b -r1.81 -r1.82
--- server/asobj/NetStreamFfmpeg.cpp    31 May 2007 21:48:33 -0000      1.81
+++ server/asobj/NetStreamFfmpeg.cpp    1 Jun 2007 23:36:48 -0000       1.82
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: NetStreamFfmpeg.cpp,v 1.81 2007/05/31 21:48:33 bjacques Exp $ */
+/* $Id: NetStreamFfmpeg.cpp,v 1.82 2007/06/01 23:36:48 bjacques Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -88,6 +88,7 @@
 
 void NetStreamFfmpeg::pause(int mode)
 {
+
        if (mode == -1)
        {
                if (m_pause) unpauseDecoding();
@@ -130,7 +131,7 @@
        sound_handler* s = get_sound_handler();
        if (s != NULL)
        {
-               s->detach_aux_streamer((void*) NULL);
+               s->detach_aux_streamer(this);
        }
 
        if (m_Frame) av_free(m_Frame);
@@ -386,6 +387,7 @@
                return false;
        }
 
+       nc->seek(0);
        inputPos = 0;
 
        // Check if the file is a FLV, in which case we use our own parser
@@ -429,9 +431,6 @@
                m_video_index = 0;
                m_audio_index = 1;
 
-               sound_handler* s = get_sound_handler();
-               if (s) s->attach_aux_streamer(audio_streamer, (void*) this);
-
                m_start_onbuffer = true;
 
                // Allocate a frame to store the decoded frame in
@@ -569,8 +568,6 @@
                        return false;
                }
 
-               s->attach_aux_streamer(audio_streamer, (void*) this);
-
        }
 
        unpauseDecoding();




reply via email to

[Prev in Thread] Current Thread [Next in Thread]