=== modified file 'gui/Player.cpp'
--- gui/Player.cpp	2008-12-04 10:21:27 +0000
+++ gui/Player.cpp	2009-02-16 04:56:08 +0000
@@ -97,7 +97,8 @@
     _fpsDebugTime(0.0),
 #endif
     _hostfd(-1),
-    _startFullscreen(false)
+    _startFullscreen(false),
+    _scaleExactFit(false)
 {
     init();
 }
@@ -460,6 +461,11 @@
     if (!_windowID && _startFullscreen) {
         _gui->setFullscreen();
     }
+    
+    if (!_windowID && _scaleExactFit) {
+        _gui->setScaleExactFit();
+    }
+    
     _gui->run();
 
     log_debug("Main loop ended, cleaning up");

=== modified file 'gui/Player.h'
--- gui/Player.h	2008-11-04 01:14:26 +0000
+++ gui/Player.h	2009-02-16 04:56:07 +0000
@@ -137,6 +137,10 @@
 	void setStartFullscreen(bool x) {
 	    _startFullscreen = x;
 	}
+	
+	void setScaleExactFit(bool x) {
+	    _scaleExactFit = x;
+	}
 
     void setAudioDumpfile(const std::string& filespec) {
         _audioDump = filespec;
@@ -288,6 +292,8 @@
 	// (Or what did you think it meant?)
 	bool _startFullscreen;
 
+    bool _scaleExactFit;
+    
     // The filename to use for dumping audio.
     std::string _audioDump;
 

=== modified file 'gui/gnash.cpp'
--- gui/gnash.cpp	2008-12-28 09:40:28 +0000
+++ gui/gnash.cpp	2009-02-16 06:00:14 +0000
@@ -106,6 +106,7 @@
     << _("  -w,  --writelog          Produce the disk based debug log") << endl
     << _("  -j,  --width <width>     Set window width") << endl
     << _("  -k,  --height <height>   Set window height") << endl
+    << _("  -S,  --exactfit          Force the SWF to scale as an exactfit") << endl
     << _("  -1,  --once              Exit when/if movie reaches the last frame") << endl
     << _("  -g,  --debugger          Turn on the SWF debugger") << endl
     << _("  -r,  --render-mode <0|1|2|3>") << endl
@@ -193,6 +194,7 @@
         { 'a', 0,               Arg_parser::no  },
         { 'p', 0,               Arg_parser::no  },
         { 's', "scale",         Arg_parser::yes },
+        { 'S', "exactfit",      Arg_parser::no },
         { 256, "max-advances",  Arg_parser::yes },
         { 257, "fullscreen",    Arg_parser::no  },        
         { 'c', 0,               Arg_parser::no  },
@@ -279,6 +281,9 @@
                                     parser.argument<float>(i),
                                     0.01f, 100.f));
                     break;
+                case 'S':
+                    player.setScaleExactFit(true);
+                    break;
                 case 'd':
                     player.setDelay( parser.argument<long>(i) );
                     break;

=== modified file 'gui/gui.cpp'
--- gui/gui.cpp	2009-01-22 20:10:39 +0000
+++ gui/gui.cpp	2009-02-16 04:56:09 +0000
@@ -82,6 +82,7 @@
     _renderer(NULL),
     _redraw_flag(true),
     _fullscreen(false),
+    _scaleExactFit(false),
     _mouseShown(true),
     _maxAdvances(0),
     _advances(0),
@@ -124,6 +125,7 @@
     _renderer(NULL),
     _redraw_flag(true),
     _fullscreen(false),
+    _scaleExactFit(false),
     _mouseShown(true),
     _maxAdvances(0),
     _advances(0),
@@ -178,6 +180,12 @@
     log_unimpl(_("Fullscreen not yet supported in this GUI"));
 }
 
+void 
+Gui::setScaleExactFit()
+{
+    _scaleExactFit = true;
+}
+
 bool
 Gui::showMouse(bool /* show */)
 {
@@ -244,36 +252,57 @@
 	switch (scaleMode)
 	{
 		case movie_root::noScale:
-			_xscale = _yscale = 1.0f;
+            if (_scaleExactFit)
+            {
+			    _xscale = (swfwidth == 0.0f) ? 1.0f : _width / swfwidth;
+			    _yscale = (swfheight == 0.0f) ? 1.0f : _height / swfheight;
+		    }
+		    else
+		    {
+			    _xscale = _yscale = 1.0f;
+		    }
 			break;
 
 		case movie_root::showAll:
 		{
-		
-			// set new scale value ( user-pixel / pseudo-pixel ). Do
-			// not divide by zero, or we end up with an invalid
-			// stage matrix that returns nan values.			
-			_xscale = (swfwidth == 0.0f) ? 1.0f : _width / swfwidth;
-			_yscale = (swfheight == 0.0f) ? 1.0f : _height / swfheight;
+            if (_scaleExactFit)
+            {
+			    _xscale = (swfwidth == 0.0f) ? 1.0f : _width / swfwidth;
+			    _yscale = (swfheight == 0.0f) ? 1.0f : _height / swfheight;
+		    }
+		    else
+		    {
+			    // set new scale value ( user-pixel / pseudo-pixel ). Do
+			    // not divide by zero, or we end up with an invalid
+			    // stage matrix that returns nan values.			
+			    _xscale = (swfwidth == 0.0f) ? 1.0f : _width / swfwidth;
+			    _yscale = (swfheight == 0.0f) ? 1.0f : _height / swfheight;
 			
-			// Scale proportionally, using smallest scale
-			if (_xscale < _yscale) _yscale = _xscale;
-			else if (_yscale < _xscale) _xscale = _yscale;
+			    // Scale proportionally, using smallest scale
+			    if (_xscale < _yscale) _yscale = _xscale;
+			    else if (_yscale < _xscale) _xscale = _yscale;
+		    }
 
 			break;
 		}
 
 		case movie_root::noBorder:
 		{
-
-			// set new scale value ( user-pixel / pseudo-pixel )
-			_xscale = (swfwidth == 0.0f) ? 1.0f : _width / swfwidth;
-			_yscale = (swfheight == 0.0f) ? 1.0f : _height / swfheight;
+            if (_scaleExactFit)
+            {
+			    _xscale = (swfwidth == 0.0f) ? 1.0f : _width / swfwidth;
+			    _yscale = (swfheight == 0.0f) ? 1.0f : _height / swfheight;
+		    }
+		    else
+		    {
+			    // set new scale value ( user-pixel / pseudo-pixel )
+			    _xscale = (swfwidth == 0.0f) ? 1.0f : _width / swfwidth;
+			    _yscale = (swfheight == 0.0f) ? 1.0f : _height / swfheight;
 			
-			// Scale proportionally, using biggest scale
-			if (_xscale > _yscale) _yscale = _xscale;
-			else if (_yscale > _xscale) _xscale = _yscale;
-
+			    // Scale proportionally, using biggest scale
+			    if (_xscale > _yscale) _yscale = _xscale;
+			    else if (_yscale > _xscale) _xscale = _yscale;
+            }
 			break;
 		}
 
@@ -288,7 +317,16 @@
 
 		default:
 		{
-			log_error("Invalid scaleMode %d", scaleMode);
+            if (_scaleExactFit)
+            {
+			    _xscale = (swfwidth == 0.0f) ? 1.0f : _width / swfwidth;
+			    _yscale = (swfheight == 0.0f) ? 1.0f : _height / swfheight;
+			    log_error("Invalid scaleMode - forcing to exactfit");
+		    }
+		    else
+		    {
+			    log_error("Invalid scaleMode %d", scaleMode);
+		    }
 			break;
 		}
 	}

=== modified file 'gui/gui.h'
--- gui/gui.h	2009-01-22 20:10:39 +0000
+++ gui/gui.h	2009-02-16 05:59:34 +0000
@@ -254,6 +254,9 @@
     ///
     virtual void unsetFullscreen();
     
+    /// Force the movie to play play scaled as an exactfit
+    void setScaleExactFit();
+    
     /// Sets whether the gui should show the system mouse pointer
     //
     /// @param show true if the mouse should be shown.
@@ -426,6 +429,9 @@
 
     // True if Gnash is running in fullscreen
     bool _fullscreen;
+    
+    // Forces Gnash to scale movie as exactfit
+    bool _scaleExactFit;
 
     // True if mouse pointer is showing
     bool _mouseShown;

