[Swfdec-commits] 4 commits - swfdec-gtk/swfdec_gtk_widget.c swfdec/swfdec_as_interpret.c swfdec/swfdec_audio_stream.c swfdec/swfdec_text_field_movie_as.c

Benjamin Otte company at kemper.freedesktop.org
Tue Jun 3 03:47:30 PDT 2008


 swfdec-gtk/swfdec_gtk_widget.c      |    7 ++++++-
 swfdec/swfdec_as_interpret.c        |    2 +-
 swfdec/swfdec_audio_stream.c        |    2 +-
 swfdec/swfdec_text_field_movie_as.c |    6 +++---
 4 files changed, 11 insertions(+), 6 deletions(-)

New commits:
commit 42a56a4e42ad29224abe0d4d7a5f6fceaeea194d
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Jun 3 12:47:03 2008 +0200

    return correct value here

diff --git a/swfdec/swfdec_audio_stream.c b/swfdec/swfdec_audio_stream.c
index b5f47c1..ba781f5 100644
--- a/swfdec/swfdec_audio_stream.c
+++ b/swfdec/swfdec_audio_stream.c
@@ -114,7 +114,7 @@ swfdec_audio_stream_render (SwfdecAudio *audio, gint16* dest,
     dest += 2 * samples;
   }
 
-  return rendered;
+  return rendered - start;
 }
 
 static guint
commit 39e8d2dd64d380a016a633172eca70e8c588d70f
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Jun 3 11:56:49 2008 +0200

    restrict widget size to screen size
    
    avoids X going bonkers for 1234567x7654321 pixel Flashs

diff --git a/swfdec-gtk/swfdec_gtk_widget.c b/swfdec-gtk/swfdec_gtk_widget.c
index f23a4fb..801cbce 100644
--- a/swfdec-gtk/swfdec_gtk_widget.c
+++ b/swfdec-gtk/swfdec_gtk_widget.c
@@ -403,9 +403,14 @@ swfdec_gtk_widget_size_request (GtkWidget *gtkwidget, GtkRequisition *req)
   } else {
     guint w, h;
     swfdec_player_get_default_size (priv->player, &w, &h);
-    /* FIXME: set some sane upper limit here? */
     req->width = MIN (w, G_MAXINT);
     req->height = MIN (h, G_MAXINT);
+    /* constrain the size - fix for huge (aka broken) Flash files */
+    if (gtk_widget_has_screen (gtkwidget)) {
+      GdkScreen *screen = gtk_widget_get_screen (gtkwidget);
+      req->width = MIN (req->width, gdk_screen_get_width (screen));
+      req->height = MIN (req->height, gdk_screen_get_height (screen));
+    }
   } 
 }
 
commit ea8757d9871a5132e6d769ff8ffc9b79027eec5d
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Jun 3 11:45:32 2008 +0200

    fix copy/paste error in comment

diff --git a/swfdec/swfdec_as_interpret.c b/swfdec/swfdec_as_interpret.c
index 322ba5d..bcdda37 100644
--- a/swfdec/swfdec_as_interpret.c
+++ b/swfdec/swfdec_as_interpret.c
@@ -687,7 +687,7 @@ swfdec_action_get_property (SwfdecAsContext *cx, guint action, const guint8 *dat
       goto error;
   }
   if (id > (cx->version > 4 ? 21 : 18)) {
-    SWFDEC_WARNING ("trying to SetProperty %u, doesn't exist", id);
+    SWFDEC_WARNING ("trying to GetProperty %u, doesn't exist", id);
     goto error;
   }
   swfdec_as_object_get_variable (SWFDEC_AS_OBJECT (movie), swfdec_movieclip_props[id].name,
commit 63756a7e773d36b2aff74d0e710969ebf71dac8c
Author: Benjamin Otte <otte at gnome.org>
Date:   Sun Jun 1 15:21:25 2008 +0200

    fix reporting of textWidth and textHeight

diff --git a/swfdec/swfdec_text_field_movie_as.c b/swfdec/swfdec_text_field_movie_as.c
index b38227c..940a77f 100644
--- a/swfdec/swfdec_text_field_movie_as.c
+++ b/swfdec/swfdec_text_field_movie_as.c
@@ -428,7 +428,7 @@ swfdec_text_field_movie_get_textHeight (SwfdecAsContext *cx,
   SWFDEC_AS_CHECK (SWFDEC_TYPE_TEXT_FIELD_MOVIE, &text, "");
 
   SWFDEC_AS_VALUE_SET_INT (ret, floor (text->layout_height * 
-	SWFDEC_TWIPS_SCALE_FACTOR * text->from_layout.yy));
+	text->from_layout.yy / SWFDEC_TWIPS_SCALE_FACTOR));
 }
 
 static void
@@ -440,8 +440,8 @@ swfdec_text_field_movie_get_textWidth (SwfdecAsContext *cx,
 
   SWFDEC_AS_CHECK (SWFDEC_TYPE_TEXT_FIELD_MOVIE, &text, "");
 
-  SWFDEC_AS_VALUE_SET_INT (ret, floor (text->layout_height *
-	SWFDEC_TWIPS_SCALE_FACTOR * text->from_layout.xx));
+  SWFDEC_AS_VALUE_SET_INT (ret, floor (text->layout_width *
+	text->from_layout.xx / SWFDEC_TWIPS_SCALE_FACTOR));
 }
 
 /*


More information about the Swfdec-commits mailing list