gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/swf/tag_loaders.cpp test...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/swf/tag_loaders.cpp test...
Date: Wed, 19 Mar 2008 21:24:39 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/03/19 21:24:39

Modified files:
        .              : ChangeLog 
        server/swf     : tag_loaders.cpp 
        testsuite/misc-ming.all: Makefile.am 
Added files:
        testsuite/misc-ming.all: streamingSoundTest1-Runner.cpp 
                                 streamingSoundTest1.c 

Log message:
                * server/swf/tag_loaders.cpp: log malformed swf if 
SOUNDSTREAMBLOCK
                  is found w/out preceeding SOUNDSTREAMHEAD.
                * testsuite/misc-ming.all/: Makefile.am,
                  streamingSoundTest1-Runner.cpp, streamingSoundTest1.c:
                  Stub test for streaming sound. Doesn't work yet, producing
                  a malformed SWF which inspired the tag_loaders.cpp change.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5981&r2=1.5982
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/tag_loaders.cpp?cvsroot=gnash&r1=1.188&r2=1.189
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/Makefile.am?cvsroot=gnash&r1=1.185&r2=1.186
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/streamingSoundTest1-Runner.cpp?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/streamingSoundTest1.c?cvsroot=gnash&rev=1.1

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5981
retrieving revision 1.5982
diff -u -b -r1.5981 -r1.5982
--- ChangeLog   19 Mar 2008 20:50:55 -0000      1.5981
+++ ChangeLog   19 Mar 2008 21:24:38 -0000      1.5982
@@ -1,5 +1,14 @@
 2008-03-19 Sandro Santilli <address@hidden>
 
+       * server/swf/tag_loaders.cpp: log malformed swf if SOUNDSTREAMBLOCK
+         is found w/out preceeding SOUNDSTREAMHEAD.
+       * testsuite/misc-ming.all/: Makefile.am,
+         streamingSoundTest1-Runner.cpp, streamingSoundTest1.c:
+         Stub test for streaming sound. Doesn't work yet, producing
+         a malformed SWF which inspired the tag_loaders.cpp change.
+
+2008-03-19 Sandro Santilli <address@hidden>
+
        * server/sprite_instance.{cpp,h}: always stop any streaming
          sound when the sprite is stopped or unloaded.
        * server/parser/sound_definition.cpp, server/vm/ASHandlers.cpp:

Index: server/swf/tag_loaders.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf/tag_loaders.cpp,v
retrieving revision 1.188
retrieving revision 1.189
diff -u -b -r1.188 -r1.189
--- server/swf/tag_loaders.cpp  5 Mar 2008 03:56:03 -0000       1.188
+++ server/swf/tag_loaders.cpp  19 Mar 2008 21:24:39 -0000      1.189
@@ -1452,7 +1452,11 @@
     media::sound_handler* handler = get_sound_handler();
 
     // If we don't have a sound_handler registered stop here
-    if (!handler) return;
+    if (!handler)
+    {
+               // log_debug ?
+        return;
+    }
 
     // Get the ID of the sound stream currently being loaded
     int handle_id = m->get_loading_sound_stream_id();
@@ -1462,7 +1466,13 @@
     media::SoundInfo* sinfo = handler->get_sound_info(handle_id);
 
     // If there is no SoundInfo something is wrong...
-    if (!sinfo) return;
+    if (!sinfo)
+       {
+               IF_VERBOSE_MALFORMED_SWF(
+               log_swferror(_("Found SOUNDSTREAMBLOCK tag w/out preceeding 
SOUNDSTREAMHEAD"));
+               );
+               return;
+       }
 
     media::audioCodecType format = sinfo->getFormat();
     unsigned int sample_count = sinfo->getSampleCount();

Index: testsuite/misc-ming.all/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/Makefile.am,v
retrieving revision 1.185
retrieving revision 1.186
diff -u -b -r1.185 -r1.186
--- testsuite/misc-ming.all/Makefile.am 10 Mar 2008 17:41:09 -0000      1.185
+++ testsuite/misc-ming.all/Makefile.am 19 Mar 2008 21:24:39 -0000      1.186
@@ -141,6 +141,8 @@
        loadMovieTestRunner \
        eventSoundTest1 \
        eventSoundTest1-Runner \
+       streamingSoundTest1 \
+       streamingSoundTest1-Runner \
        DrawingApiTestRunner \
        DragDropTestRunner   \
        frame_label_test \
@@ -413,6 +415,27 @@
        eventSoundTest1.swf      \
        $(NULL)
 
+streamingSoundTest1_SOURCES = streamingSoundTest1.c
+streamingSoundTest1_LDADD = libgnashmingutils.la
+
+streamingSoundTest1.swf: streamingSoundTest1
+       ./streamingSoundTest1 $(srcdir)/../media/sound1.mp3
+
+streamingSoundTest1_Runner_SOURCES = \
+       streamingSoundTest1-Runner.cpp \
+       $(NULL)
+streamingSoundTest1_Runner_CXXFLAGS = \
+       -DTGTDIR='"$(abs_builddir)"' \
+       $(NULL)
+streamingSoundTest1_Runner_LDADD = \
+       $(top_builddir)/testsuite/libtestsuite.la \
+       $(NULL)
+streamingSoundTest1_Runner_DEPENDENCIES = \
+       $(top_builddir)/testsuite/libtestsuite.la \
+       streamingSoundTest1.swf      \
+       $(NULL)
+
+
 DefineEditTextVariableNameTest_SOURCES =       \
        DefineEditTextVariableNameTest.c        \
        $(NULL)

Index: testsuite/misc-ming.all/streamingSoundTest1-Runner.cpp
===================================================================
RCS file: testsuite/misc-ming.all/streamingSoundTest1-Runner.cpp
diff -N testsuite/misc-ming.all/streamingSoundTest1-Runner.cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-ming.all/streamingSoundTest1-Runner.cpp      19 Mar 2008 
21:24:39 -0000      1.1
@@ -0,0 +1,80 @@
+/* 
+ *   Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ *
+ */ 
+
+#define INPUT_FILENAME "streamingSoundTest1.swf"
+
+#include "MovieTester.h"
+#include "sprite_instance.h"
+#include "character.h"
+#include "dlist.h"
+#include "log.h"
+#include "GnashException.h"
+
+#include "check.h"
+
+#include <string>
+#include <iostream>
+#include <cassert>
+#include <memory>
+
+using namespace gnash;
+using namespace std;
+
+int
+main(int /*argc*/, char** /*argv*/)
+{
+       string filename = string(TGTDIR) + string("/") + string(INPUT_FILENAME);
+       auto_ptr<MovieTester> t;
+
+       try
+       {
+               t.reset(new MovieTester(filename));
+       }
+       catch (const GnashException& e)
+       {
+               std::cerr << "Error initializing MovieTester: " << e.what() << 
std::endl;
+               exit(EXIT_FAILURE);
+       }
+
+       MovieTester& tester = *t;
+
+       tester.advance();
+
+       gnash::LogFile& dbglogfile = gnash::LogFile::getDefaultInstance();
+       dbglogfile.setVerbosity(1);
+       dbglogfile.setActionDump(1);
+
+       sprite_instance* root = tester.getRootMovie();
+       assert(root);
+
+       check_equals(root->get_frame_count(), 1);
+
+       if ( ! tester.canTestSound() )
+       {
+               cout << "UNTESTED: sounds can't be tested with this build." << 
endl;
+               return EXIT_SUCCESS; // so testing doesn't abort
+       } 
+
+       check_equals(tester.soundsStarted(), 0);
+       check_equals(tester.soundsStopped(), 0);
+
+
+}
+

Index: testsuite/misc-ming.all/streamingSoundTest1.c
===================================================================
RCS file: testsuite/misc-ming.all/streamingSoundTest1.c
diff -N testsuite/misc-ming.all/streamingSoundTest1.c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ testsuite/misc-ming.all/streamingSoundTest1.c       19 Mar 2008 21:24:39 
-0000      1.1
@@ -0,0 +1,78 @@
+/* 
+ *   Copyright (C) 2007 Free Software Foundation, Inc.
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */ 
+
+/*
+ * Test for streaming sound
+ * 
+ */
+
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ming.h>
+
+#include "ming_utils.h"
+
+#define OUTPUT_VERSION 6
+#define OUTPUT_FILENAME "streamingSoundTest1.swf"
+
+
+int
+main(int argc, char** argv)
+{
+  SWFMovie mo;
+  SWFMovieClip mc;
+  SWFSoundStream ss;
+  FILE* sound_f;
+  const char* sound_filename;
+  SWFDisplayItem it;
+
+  if ( argc>1 ) {
+    sound_filename=argv[1];
+  } else {
+    sound_filename="sound1.mp3";
+  }
+
+  sound_f = fopen(sound_filename, "r");
+  if ( ! sound_f ) {
+    perror(sound_filename);
+    return 1;
+  }
+
+  Ming_init();
+  Ming_useSWFVersion (OUTPUT_VERSION);
+  
+  mo = newSWFMovie();
+  SWFMovie_setDimension(mo, 100, 100);
+  SWFMovie_setRate(mo, 1);
+
+  ss = newSWFSoundStream(sound_f);
+
+  mc = newSWFMovieClip();
+  SWFMovieClip_setSoundStream(mc, ss, 1);
+  SWFMovieClip_nextFrame(mc);
+
+  it = SWFMovie_add(mo, mc);
+  SWFMovie_nextFrame(mo);
+
+  //Output movie
+  puts("Saving " OUTPUT_FILENAME );
+  SWFMovie_save(mo, OUTPUT_FILENAME);
+
+  return 0;
+}




reply via email to

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