[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash/gui Player.cpp
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash/gui Player.cpp |
Date: |
Mon, 25 Sep 2006 15:12:01 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 06/09/25 15:12:01
Modified files:
gui : Player.cpp
Log message:
ChangeLog
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/Player.cpp?cvsroot=gnash&r1=1.4&r2=1.5
Patches:
Index: Player.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/Player.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- Player.cpp 25 Sep 2006 11:48:33 -0000 1.4
+++ Player.cpp 25 Sep 2006 15:12:01 -0000 1.5
@@ -58,6 +58,11 @@
# endif
#endif
+
+#if defined(_WIN32) || defined(WIN32)
+# include "getopt.c"
+#endif
+
#include "NullGui.h"
#include "gnash.h"
@@ -200,21 +205,22 @@
#endif
}
- // Load the actual movie.
- gnash::movie_definition *md;
+ // Get info about the width & height of the movie.
+ int movie_version = 0, movie_width = 0, movie_height = 0;
+ float movie_fps = 30.0f;
try {
- md = gnash::create_library_movie(URL(infile), url);
+ gnash::get_movie_info(URL(infile), &movie_version, &movie_width,
+ &movie_height, &movie_fps, NULL, NULL);
} catch (const GnashException& er) {
fprintf(stderr, "%s\n", er.what());
- md = NULL;
- return EXIT_FAILURE;
+ movie_version = 0;
}
- // Get info about the width & height of the movie.
- int movie_width = (int)md->get_width_pixels();
- int movie_height = (int)md->get_height_pixels();
- float movie_fps = md->get_frame_rate();
+ if (movie_version == 0) {
+ std::cerr << "Error: can't get info about " << infile << "." << endl;
+ return EXIT_FAILURE;
+ }
if (!width) {
width = int(movie_width * scale);
@@ -239,6 +245,16 @@
gui.createWindow(infile, width, height);
+ // Load the actual movie.
+ gnash::movie_definition *md;
+
+ try {
+ md = gnash::create_library_movie(URL(infile), url);
+ } catch (const GnashException& er) {
+ fprintf(stderr, "%s\n", er.what());
+ md = NULL;
+ }
+
gnash::movie_interface *m = create_library_movie_inst(md);
assert(m);