[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/asobj/NetStreamGst.cpp
From: |
Tomas Groth |
Subject: |
[Gnash-commit] gnash ChangeLog server/asobj/NetStreamGst.cpp |
Date: |
Sat, 26 May 2007 20:25:12 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Tomas Groth <tgc> 07/05/26 20:25:12
Modified files:
. : ChangeLog
server/asobj : NetStreamGst.cpp
Log message:
* server/asobj/NetStreamGst.cpp: Don't allow play url to be
changed,
might not be correct behavoir... Fix some issues when closing
NetStream before playback has been set up.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3367&r2=1.3368
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStreamGst.cpp?cvsroot=gnash&r1=1.47&r2=1.48
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3367
retrieving revision 1.3368
diff -u -b -r1.3367 -r1.3368
--- ChangeLog 26 May 2007 18:17:31 -0000 1.3367
+++ ChangeLog 26 May 2007 20:25:12 -0000 1.3368
@@ -1,3 +1,9 @@
+2007-05-26 Tomas Groth Christensen <address@hidden>
+
+ * server/asobj/NetStreamGst.cpp: Don't allow play url to be changed,
+ might not be correct behavoir... Fix some issues when closing
+ NetStream before playback has been set up.
+
2007-05-26 Ann Barcomb <address@hidden>
* doc/C/gnashrc.xml: Corrected spelling
Index: server/asobj/NetStreamGst.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStreamGst.cpp,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -b -r1.47 -r1.48
--- server/asobj/NetStreamGst.cpp 18 May 2007 16:23:28 -0000 1.47
+++ server/asobj/NetStreamGst.cpp 26 May 2007 20:25:12 -0000 1.48
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: NetStreamGst.cpp,v 1.47 2007/05/18 16:23:28 strk Exp $ */
+/* $Id: NetStreamGst.cpp,v 1.48 2007/05/26 20:25:12 tgc Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -98,6 +98,7 @@
NetStreamGst::~NetStreamGst()
{
close();
+ delete m_parser;
}
void NetStreamGst::pause(int mode)
@@ -129,12 +130,24 @@
}
}
}
+
+ if (!pipeline && !m_pause && !m_go) {
+ setStatus(playStart);
+ m_go = true;
+ // To avoid blocking while connecting, we use a thread.
+#ifndef DISABLE_START_THREAD
+ startThread = new
boost::thread(boost::bind(NetStreamGst::playbackStarter, this));
+#else
+ startPlayback(this);
+#endif
+ }
}
void NetStreamGst::close()
{
if (m_go)
{
+ setStatus(playStop);
m_go = false;
#ifndef DISABLE_START_THREAD
startThread->join();
@@ -150,9 +163,20 @@
// Should we keep the ref if the above failed ?
// Unreffing the pipeline should also unref all elements in it.
gst_object_unref (GST_OBJECT (pipeline));
+ pipeline = NULL;
- if (m_imageframe) delete m_imageframe;
+ boost::mutex::scoped_lock lock(image_mutex);
+
+ delete m_imageframe;
+ m_imageframe = NULL;
+
+ _handoffVideoSigHandler = 0;
+ _handoffAudioSigHandler = 0;
+ videowidth = 0;
+ videoheight = 0;
+ m_clock_offset = 0;
+ m_pausePlayback = false;
}
@@ -179,8 +203,7 @@
return 0;
}
-
- url += c_url;
+ if (url.size() == 0) url += c_url;
// Remove any "mp3:" prefix. Maybe should use this to mark as audio-only
if (url.compare(0, 4, std::string("mp3:")) == 0) {
url = url.substr(4);
@@ -712,6 +735,9 @@
void
NetStreamGst::startPlayback()
{
+ // This should only happen if close() is called before this thread is
ready
+ if (!m_go) return;
+
boost::intrusive_ptr<NetConnection> nc = _netCon;
assert(nc);
@@ -732,15 +758,18 @@
nc->seek(0);
if (head[0] == 'F' && head[1] == 'L' && head[2] == 'V') {
m_isFLV = true;
+ if (!m_parser) {
m_parser = new FLVParser(); // TODO: define ownership, use
auto_ptr !
if (!nc->connectParser(*(m_parser))) {
setStatus(streamNotFound);
- log_debug(_("Gnash could not open movie: %s"),
url.c_str());
+ log_error(_("Gnash could not open FLV movie:
%s"), url.c_str());
+ delete m_parser;
return;
-
}
}
+ }
+
// setup the GnashNC plugin if we are not decoding FLV
if (!m_isFLV) _gst_plugin_register_static (&gnash_plugin_desc);
@@ -925,8 +954,13 @@
void
NetStreamGst::seek(double pos)
{
-
- if (!pipeline) return;
+ if (!pipeline) {
+ if (m_parser) {
+ uint32_t newpos =
m_parser->seek(static_cast<uint32_t>(pos*1000));
+ m_clock_offset = 0;
+ }
+ return;
+ }
if (m_isFLV) {
uint32_t newpos =
m_parser->seek(static_cast<uint32_t>(pos*1000));