gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog libbase/FLVParser.cpp server/as...


From: Tomas Groth
Subject: [Gnash-commit] gnash ChangeLog libbase/FLVParser.cpp server/as...
Date: Sat, 26 May 2007 13:57:10 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Tomas Groth <tgc>       07/05/26 13:57:09

Modified files:
        .              : ChangeLog 
        libbase        : FLVParser.cpp 
        server/asobj   : NetConnection.cpp NetStreamFfmpeg.cpp 

Log message:
                * libbase/FLVParser.cpp: When seeking the frame after the 
correct
                  one was returned.
                * server/asobj/NetConnection.cpp: Don't allow url prefix to be 
changed,
                  might not be correct behavoir...
                * server/asobj/NetStreamFfmpeg.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.3361&r2=1.3362
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/FLVParser.cpp?cvsroot=gnash&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetConnection.cpp?cvsroot=gnash&r1=1.44&r2=1.45
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStreamFfmpeg.cpp?cvsroot=gnash&r1=1.55&r2=1.56

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.3361
retrieving revision 1.3362
diff -u -b -r1.3361 -r1.3362
--- ChangeLog   26 May 2007 11:57:52 -0000      1.3361
+++ ChangeLog   26 May 2007 13:57:08 -0000      1.3362
@@ -1,3 +1,13 @@
+2007-05-26 Tomas Groth Christensen <address@hidden>
+
+       * libbase/FLVParser.cpp: When seeking the frame after the correct
+         one was returned.
+       * server/asobj/NetConnection.cpp: Don't allow url prefix to be changed,
+         might not be correct behavoir...
+       * server/asobj/NetStreamFfmpeg.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 Bastiaan Jacques <address@hidden>
 
        * plugin/plugin.cpp: Initialise _width and _height to safe defaults,

Index: libbase/FLVParser.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/FLVParser.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- libbase/FLVParser.cpp       23 May 2007 20:31:07 -0000      1.14
+++ libbase/FLVParser.cpp       26 May 2007 13:57:09 -0000      1.15
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-// $Id: FLVParser.cpp,v 1.14 2007/05/23 20:31:07 bjacques Exp $
+// $Id: FLVParser.cpp,v 1.15 2007/05/26 13:57:09 tgc Exp $
 
 #include "FLVParser.h"
 #include "amf.h"
@@ -304,7 +304,7 @@
        }
 
        gnash::log_debug("Seek (audio): " SIZET_FMT "/" SIZET_FMT " (%u/%u)", 
bestFrame, numFrames, _audioFrames[bestFrame]->timestamp, time);
-       _nextAudioFrame = bestFrame + 1;
+       _nextAudioFrame = bestFrame;
        return _audioFrames[bestFrame]->timestamp;
 
 }
@@ -411,7 +411,7 @@
 
        gnash::log_debug("Seek (video): " SIZET_FMT "/" SIZET_FMT " (%u/%u)", 
bestFrame, numFrames, _videoFrames[bestFrame]->timestamp, time);
 
-       _nextVideoFrame = bestFrame+1;
+       _nextVideoFrame = bestFrame;
        assert( _videoFrames[bestFrame]->isKeyFrame() );
        return _videoFrames[bestFrame]->timestamp;
 }
@@ -647,7 +647,7 @@
                _audio = false;
                _video = true;
        } else {
-               printf("Weird bit mask\n");
+               gnash::log_debug("Weird FLV bit mask\n");
        }
 
        _lastParsedPosition = 9;

Index: server/asobj/NetConnection.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetConnection.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- server/asobj/NetConnection.cpp      7 May 2007 11:51:52 -0000       1.44
+++ server/asobj/NetConnection.cpp      26 May 2007 13:57:09 -0000      1.45
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: NetConnection.cpp,v 1.44 2007/05/07 11:51:52 strk Exp $ */
+/* $Id: NetConnection.cpp,v 1.45 2007/05/26 13:57:09 tgc Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -111,6 +111,10 @@
        // 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;
+
        _url += url;
 }
 

Index: server/asobj/NetStreamFfmpeg.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStreamFfmpeg.cpp,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -b -r1.55 -r1.56
--- server/asobj/NetStreamFfmpeg.cpp    23 May 2007 07:42:16 -0000      1.55
+++ server/asobj/NetStreamFfmpeg.cpp    26 May 2007 13:57:09 -0000      1.56
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: NetStreamFfmpeg.cpp,v 1.55 2007/05/23 07:42:16 tgc Exp $ */
+/* $Id: NetStreamFfmpeg.cpp,v 1.56 2007/05/26 13:57:09 tgc Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -123,6 +123,9 @@
                s->detach_aux_streamer((void*) NULL);
        }
 
+       // Make sure al decoding has stopped
+       boost::mutex::scoped_lock lock(decoding_mutex);
+
        if (m_Frame) av_free(m_Frame);
        m_Frame = NULL;
 
@@ -139,6 +142,9 @@
        }
 
        delete m_imageframe;
+       m_imageframe = NULL;
+       delete m_unqueued_data;
+       m_unqueued_data = NULL;
 
        while (m_qvideo.size() > 0)
        {
@@ -220,7 +226,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);
@@ -388,6 +394,7 @@
        nc->seek(0);
        if (std::string(head) == "FLV") {
                ns->m_isFLV = true;
+               if (!ns->m_parser) {
                ns->m_parser = new FLVParser(); // TODO: define ownership, use 
auto_ptr !
                if (!nc->connectParser(*(ns->m_parser))) {
                        ns->setStatus(streamNotFound);
@@ -395,6 +402,7 @@
                        delete ns->m_parser;
                        return false;
                }
+               }
 
                // Init the avdecoder-decoder
                avcodec_init();
@@ -593,7 +601,10 @@
 void NetStreamFfmpeg::av_streamer(NetStreamFfmpeg* ns)
 {
 
-       if (!ns->m_parser && !ns->m_FormatCtx) {
+       // This should only happen if close() is called before this thread is 
ready
+       if (!ns->m_go) return;
+
+       if (!ns->m_ACodecCtx && !ns->m_VCodecCtx && !ns->m_FormatCtx) {
                if (!ns->startPlayback()) return;
        } else {
                // We need to restart the audio
@@ -603,9 +614,6 @@
                }
        }
 
-       // This should only happen if close() is called before setup is complete
-       if (!ns->m_go) return;
-
        ns->setStatus(playStart);
 
        ns->m_last_video_timestamp = 0;
@@ -733,6 +741,8 @@
 
 bool NetStreamFfmpeg::decodeAudio(AVPacket* packet)
 {
+       if (!m_ACodecCtx) return false;
+
        int frame_size;
        unsigned int bufsize = (AVCODEC_MAX_AUDIO_FRAME_SIZE * 3) / 2;
 
@@ -799,6 +809,8 @@
 
 bool NetStreamFfmpeg::decodeVideo(AVPacket* packet)
 {
+       if (!m_VCodecCtx) return false;
+
        int got = 0;
        avcodec_decode_video(m_VCodecCtx, m_Frame, &got, packet->data, 
packet->size);
        if (got) {
@@ -911,6 +923,7 @@
 
                return true;
        }
+
        return false;
 }
 
@@ -981,7 +994,11 @@
 
        // Seek to new position
        if (m_isFLV) {
+               if (m_parser) {
                newpos = m_parser->seek(static_cast<uint32_t>(pos*1000));
+               } else {
+                       newpos = 0;
+               }
        } else if (m_FormatCtx) {
 
                timebase = 
static_cast<double>(m_FormatCtx->streams[m_video_index]->time_base.num) / 
static_cast<double>(m_FormatCtx->streams[m_video_index]->time_base.den);
@@ -1033,6 +1050,7 @@
                m_last_video_timestamp = newtime;
                m_current_timestamp = newtime;
        }
+       
        // Flush the queues
        while (m_qvideo.size() > 0)
        {




reply via email to

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