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/vi...


From: Tomas Groth
Subject: [Gnash-commit] gnash ChangeLog libbase/FLVParser.cpp server/vi...
Date: Thu, 06 Sep 2007 12:21:06 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Tomas Groth <tgc>       07/09/06 12:21:06

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

Log message:
                * libbase/FLVParser.cpp: Made it more robust by accepting empty
                   tags, fixing bug #20889.
                * server/video_stream_instance.cpp: Check for data being NULL.
                * server/asobj/NetStreamFfmpeg.cpp: A few changes to make it
                  work better with only video or audio - not complete yet.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4237&r2=1.4238
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/FLVParser.cpp?cvsroot=gnash&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/gnash/server/video_stream_instance.cpp?cvsroot=gnash&r1=1.36&r2=1.37
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetStreamFfmpeg.cpp?cvsroot=gnash&r1=1.88&r2=1.89

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4237
retrieving revision 1.4238
diff -u -b -r1.4237 -r1.4238
--- ChangeLog   6 Sep 2007 09:45:44 -0000       1.4237
+++ ChangeLog   6 Sep 2007 12:21:05 -0000       1.4238
@@ -1,3 +1,11 @@
+2007-09-06 Tomas Groth Christensen <address@hidden>
+
+       * libbase/FLVParser.cpp: Made it more robust by accepting empty
+          tags, fixing bug #20889.
+       * server/video_stream_instance.cpp: Check for data being NULL.
+       * server/asobj/NetStreamFfmpeg.cpp: A few changes to make it
+         work better with only video or audio - not complete yet.
+
 2007-09-06 Sandro Santilli <address@hidden>
 
        * testsuite/misc-swfc.all/: Dejagnu.sc, check.sc:

Index: libbase/FLVParser.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/FLVParser.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- libbase/FLVParser.cpp       1 Jul 2007 10:54:06 -0000       1.22
+++ libbase/FLVParser.cpp       6 Sep 2007 12:21:06 -0000       1.23
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-// $Id: FLVParser.cpp,v 1.22 2007/07/01 10:54:06 bjacques Exp $
+// $Id: FLVParser.cpp,v 1.23 2007/09/06 12:21:06 tgc Exp $
 
 #include "FLVParser.h"
 #include "amf.h"
@@ -530,6 +530,11 @@
        // Check if there is enough data to parse the body of the frame
        if (!_lt.isPositionConfirmed(_lastParsedPosition+15+bodyLength)) return 
false;
 
+       _lastParsedPosition += 15 + bodyLength;
+
+       // check for empty tag
+       if (bodyLength == 0) return true;
+
        if (tag[0] == AUDIO_TAG) {
                FLVAudioFrame* frame = new FLVAudioFrame;
                frame->dataSize = bodyLength - 1;
@@ -552,7 +557,7 @@
 
                        _audioInfo = new FLVAudioInfo((tag[11] & 0xf0) >> 4, 
samplerate, samplesize, (tag[11] & 0x01) >> 0, 0);
                }
-               _lastParsedPosition += 15 + bodyLength;
+
 
        } else if (tag[0] == VIDEO_TAG) {
                FLVVideoFrame* frame = new FLVVideoFrame;
@@ -615,7 +620,6 @@
                        // Create the videoinfo
                        _videoInfo = new FLVVideoInfo(codec, width, height, 0 
/*frameRate*/, 0 /*duration*/);
                }
-               _lastParsedPosition += 15 + bodyLength;
 
        } else if (tag[0] == META_TAG) {
                // Extract information from the meta tag
@@ -625,7 +629,6 @@
                amf::AMF* amfParser = new amf::AMF();
                amfParser->parseAMF(metaTag);*/
 
-               _lastParsedPosition += 15 + bodyLength;
        } else {
                _parsingComplete = true;
                return false;

Index: server/video_stream_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/video_stream_instance.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- server/video_stream_instance.cpp    31 Aug 2007 21:53:31 -0000      1.36
+++ server/video_stream_instance.cpp    6 Sep 2007 12:21:06 -0000       1.37
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 // 
 
-// $Id: video_stream_instance.cpp,v 1.36 2007/08/31 21:53:31 strk Exp $
+// $Id: video_stream_instance.cpp,v 1.37 2007/09/06 12:21:06 tgc Exp $
 
 #include "sprite_instance.h"
 #include "video_stream_instance.h"
@@ -211,6 +211,8 @@
                assert(m_def);
                m_def->get_frame_data(current_frame, &data, &size);
 
+               if (size > 0 && data) {
+
                std::auto_ptr<image::image_base> i ( 
m_decoder->decodeFrame(data, size) );
                if (i.get())
                {
@@ -218,7 +220,9 @@
                } else {
                        log_error(_("An error occured while decoding video 
frame"));
                }
-
+               } else {
+                       log_error(_("An error occured while decoding video 
frame"));
+               }
        }
 
        clear_invalidated();

Index: server/asobj/NetStreamFfmpeg.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetStreamFfmpeg.cpp,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -b -r1.88 -r1.89
--- server/asobj/NetStreamFfmpeg.cpp    1 Jul 2007 10:54:29 -0000       1.88
+++ server/asobj/NetStreamFfmpeg.cpp    6 Sep 2007 12:21:06 -0000       1.89
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: NetStreamFfmpeg.cpp,v 1.88 2007/07/01 10:54:29 bjacques Exp $ */
+/* $Id: NetStreamFfmpeg.cpp,v 1.89 2007/09/06 12:21:06 tgc Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -413,12 +413,14 @@
                m_VCodecCtx = initFlvVideo(m_parser.get());
                if (!m_VCodecCtx) {
                        log_msg(_("Failed to initialize FLV video codec"));
-                       return false;
                }
 
                m_ACodecCtx = initFlvAudio(m_parser.get());
                if (!m_ACodecCtx) {
                        log_msg(_("Failed to initialize FLV audio codec"));
+               }
+
+               if (!m_ACodecCtx && !m_VCodecCtx) {
                        return false;
                }
 
@@ -642,7 +644,7 @@
 
                if (ns->m_isFLV) {
                        // If queues are full then don't bother filling it
-                       if (ns->m_qvideo.size() < 20 || ns->m_qvideo.size() < 
20) {
+                       if ((ns->m_VCodecCtx && ns->m_qvideo.size() < 20) || 
(ns->m_ACodecCtx && ns->m_qaudio.size() < 20)) {
 
                                // If we have problems with decoding - break
                                if (!ns->decodeFLVFrame() && 
ns->m_start_onbuffer == false && ns->m_qvideo.size() == 0 && 
ns->m_qaudio.size() == 0)
@@ -716,10 +718,10 @@
 {
        AVPacket packet;
 
-       FLVFrame* frame;
-       if (m_qvideo.size() < m_qaudio.size()) {
+       FLVFrame* frame = NULL;
+       if (m_qvideo.size() < m_qaudio.size() && m_VCodecCtx) {
                frame = m_parser->nextVideoFrame();
-       } else {
+       } else if (m_ACodecCtx) {
                frame = m_parser->nextAudioFrame();
        }
 
@@ -1215,7 +1217,7 @@
        // Re-connect to the soundhandler.
        // It was disconnected to avoid to keep playing sound while paused
        sound_handler* s = get_sound_handler();
-       if (s) s->attach_aux_streamer(audio_streamer, (void*) this);
+       if (s && m_ACodecCtx) s->attach_aux_streamer(audio_streamer, (void*) 
this);
 }
 
 




reply via email to

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