gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/asobj/NetStreamFfmpeg.cp...


From: Bastiaan Jacques
Subject: [Gnash-commit] gnash ChangeLog server/asobj/NetStreamFfmpeg.cp...
Date: Fri, 06 Apr 2007 22:16:36 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Bastiaan Jacques <bjacques>     07/04/06 22:16:36

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

Log message:
        Fix a deadlock on non-glibc
        platforms by waiting for a thread rather than hoping for a 
        certain execution order (which is fundamentally incompatible with
        threads)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2802&r2=1.2803
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStreamFfmpeg.cpp?cvsroot=gnash&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStreamFfmpeg.h?cvsroot=gnash&r1=1.16&r2=1.17

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2802
retrieving revision 1.2803
diff -u -b -r1.2802 -r1.2803
--- ChangeLog   6 Apr 2007 19:56:15 -0000       1.2802
+++ ChangeLog   6 Apr 2007 22:16:36 -0000       1.2803
@@ -1,3 +1,10 @@
+2007-04-07 Bastiaan Jacques <address@hidden>
+
+       * server/NetStreamFfmpeg{.cpp, .h}: Fix a deadlock on non-glibc
+       platforms by waiting for a thread rather than hoping for a
+       certain execution order (which is fundamentally incompatible with
+       threads).
+
 2007-04-06 Sandro Santilli <address@hidden>
 
        * server/character.cpp: stop notifying unload event queuing

Index: server/asobj/NetStreamFfmpeg.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStreamFfmpeg.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- server/asobj/NetStreamFfmpeg.cpp    4 Apr 2007 20:30:45 -0000       1.29
+++ server/asobj/NetStreamFfmpeg.cpp    6 Apr 2007 22:16:36 -0000       1.30
@@ -14,7 +14,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: NetStreamFfmpeg.cpp,v 1.29 2007/04/04 20:30:45 bjacques Exp $ */
+/* $Id: NetStreamFfmpeg.cpp,v 1.30 2007/04/06 22:16:36 bjacques Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -246,9 +246,6 @@
                // To avoid blocking while connecting, we use a thread.
                startThread = new 
boost::thread(boost::bind(NetStreamFfmpeg::startPlayback, this));
 
-               // This lock prevents the decoding from starting before the 
Connection
-               // and decoder is ready.
-               lock = new boost::mutex::scoped_lock(start_mutex);
        } else {
                // We need to restart the audio
                sound_handler* s = get_sound_handler();
@@ -364,7 +361,6 @@
                ns->m_Frame = avcodec_alloc_frame();
 
                // By deleting this lock we allow the av_streamer-thread to 
start its work
-               delete ns->lock;
                return;
        }
 
@@ -514,16 +510,17 @@
 
        ns->m_pause = false;
        
-       // By deleting this lock we allow the av_streamer-thread to start its 
work
-       delete ns->lock;
        return;
 }
 
 // decoder thread
 void NetStreamFfmpeg::av_streamer(NetStreamFfmpeg* ns)
 {
-
-       boost::mutex::scoped_lock  lock(ns->start_mutex);
+       // Wait for startThread to finish.
+       // XXX if this method is to start right after startThread finishes, why 
is this
+       //     method not called directly by startThread, instead of having its 
own
+       //     execution thread?
+       ns->startThread->join();
 
        // This should only happen if close() is called before setup is complete
        if (!ns->m_go) return;

Index: server/asobj/NetStreamFfmpeg.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStreamFfmpeg.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- server/asobj/NetStreamFfmpeg.h      30 Mar 2007 13:57:27 -0000      1.16
+++ server/asobj/NetStreamFfmpeg.h      6 Apr 2007 22:16:36 -0000       1.17
@@ -14,7 +14,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: NetStreamFfmpeg.h,v 1.16 2007/03/30 13:57:27 tgc Exp $ */
+/* $Id: NetStreamFfmpeg.h,v 1.17 2007/04/06 22:16:36 bjacques Exp $ */
 
 #ifndef __NETSTREAMFFMPEG_H__
 #define __NETSTREAMFFMPEG_H__
@@ -211,8 +211,6 @@
        boost::thread *m_thread;
        boost::thread *startThread;
        boost::mutex decoding_mutex;
-       boost::mutex start_mutex;
-       boost::mutex::scoped_lock *lock;
 
        // Are the playing loop running or not
        volatile bool m_go;




reply via email to

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