summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tpm@src.gnome.org>2006-08-25 15:44:47 +0000
committerTim-Philipp Müller <tpm@src.gnome.org>2006-08-25 15:44:47 +0000
commit65edb49807bf7873ec20b74bd3912588d59fa333 (patch)
treede21c498f561093bc5f0f5687452b9dfa22bc9fd
parente63806c38436db3d02b2c7e4012a3d71467c4229 (diff)
Remove hacks needed to deal with certain GStreamer-0.8 backend issues
* src/totem-properties-view.c: (totem_properties_view_finalize), (totem_properties_view_set_location): * src/totem-video-thumbnailer.c: (main): Remove hacks needed to deal with certain GStreamer-0.8 backend issues (#352831).
-rw-r--r--ChangeLog8
-rw-r--r--src/totem-properties-view.c48
-rw-r--r--src/totem-video-thumbnailer.c24
3 files changed, 15 insertions, 65 deletions
diff --git a/ChangeLog b/ChangeLog
index dee8d869..ca85f1ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-08-25 Tim-Philipp Müller <tim at centricular dot net>
+
+ * src/totem-properties-view.c: (totem_properties_view_finalize),
+ (totem_properties_view_set_location):
+ * src/totem-video-thumbnailer.c: (main):
+ Remove hacks needed to deal with certain GStreamer-0.8 backend
+ issues (#352831).
+
2006-08-24 Bastien Nocera <hadess@hadess.net>
* data/mime-type-list.txt: add audio/AMR and audio/AMR-WB mime-types
diff --git a/src/totem-properties-view.c b/src/totem-properties-view.c
index 56b0c94c..a8188817 100644
--- a/src/totem-properties-view.c
+++ b/src/totem-properties-view.c
@@ -36,11 +36,9 @@
struct TotemPropertiesViewPriv {
GtkWidget *label;
- char *location;
GtkWidget *vbox;
BaconVideoWidgetProperties *props;
BaconVideoWidget *bvw;
- guint timeout_id, try;
};
static GObjectClass *parent_class = NULL;
@@ -101,23 +99,6 @@ on_got_metadata_event (BaconVideoWidget *bvw, TotemPropertiesView *props)
(props->priv->props, props->priv->bvw);
}
-static gboolean
-on_timeout_event (TotemPropertiesView *props)
-{
- /* FIXME: hack for the GStreamer backend which signals metadata
- * in small chunks instead of all-at-once. */
- if (props->priv->try++ >= 5) {
- bacon_video_widget_close (props->priv->bvw);
- g_free (props->priv->location);
- props->priv->location = NULL;
- props->priv->timeout_id = 0;
-
- return FALSE;
- }
-
- return TRUE;
-}
-
static void
totem_properties_view_init (TotemPropertiesView *props)
{
@@ -164,12 +145,6 @@ totem_properties_view_finalize (GObject *object)
g_object_unref (G_OBJECT (props->priv->label));
props->priv->bvw = NULL;
props->priv->label = NULL;
- g_free (props->priv->location);
- props->priv->location = NULL;
- if (props->priv->timeout_id != 0) {
- g_source_remove (props->priv->timeout_id);
- props->priv->timeout_id = 0;
- }
g_free (props->priv);
}
props->priv = NULL;
@@ -196,43 +171,28 @@ totem_properties_view_set_location (TotemPropertiesView *props,
{
g_assert (TOTEM_IS_PROPERTIES_VIEW (props));
- if (props->priv->timeout_id != 0) {
- g_source_remove (props->priv->timeout_id);
- props->priv->timeout_id = 0;
- }
-
if (location != NULL && props->priv->bvw != NULL) {
GError *error = NULL;
- g_free(props->priv->location);
bacon_video_widget_close (props->priv->bvw);
- props->priv->location = g_strdup (location);
bacon_video_widget_properties_reset (props->priv->props);
+
if (bacon_video_widget_open (props->priv->bvw, location, &error) == FALSE) {
- g_free (props->priv->location);
- props->priv->location = NULL;
g_warning ("Couldn't open %s: %s", location, error->message);
g_error_free (error);
return;
}
- /* Already closed? */
- if (props->priv->location == NULL)
- return;
if (bacon_video_widget_play (props->priv->bvw, &error) == FALSE) {
- g_free (props->priv->location);
- props->priv->location = NULL;
g_warning ("Couldn't play %s: %s", location, error->message);
g_error_free (error);
bacon_video_widget_close (props->priv->bvw);
+ return;
}
- props->priv->timeout_id =
- g_timeout_add (200, (GSourceFunc) on_timeout_event,
- props);
+
+ bacon_video_widget_close (props->priv->bvw);
} else {
bacon_video_widget_close (props->priv->bvw);
- g_free (props->priv->location);
- props->priv->location = NULL;
bacon_video_widget_properties_reset (props->priv->props);
}
}
diff --git a/src/totem-video-thumbnailer.c b/src/totem-video-thumbnailer.c
index b4654de6..15608072 100644
--- a/src/totem-video-thumbnailer.c
+++ b/src/totem-video-thumbnailer.c
@@ -429,17 +429,8 @@ int main (int argc, char *argv[])
exit (1);
}
- /* A 3rd into the file - multi-times = HACK for gst backend... */
- i = 0;
- do {
- if (i != 0) {
- g_usleep (HALF_SECOND);
- g_main_iteration (FALSE);
- }
- length = bacon_video_widget_get_stream_length (bvw);
- i++;
- } while (length == 0 && i < 20);
-
+ /* Jump a 3rd into the file */
+ length = bacon_video_widget_get_stream_length (bvw);
if (length > MIN_LEN_FOR_SEEK)
{
if (bacon_video_widget_seek
@@ -461,16 +452,7 @@ int main (int argc, char *argv[])
exit (1);
}
- /* 10 seconds! */
- i = 0;
- do {
- /* This is a hack for the gst backend because it resyncs
- * after a seekj asynchronously, and so a direct get_frame()
- * would still return the old frame. */
- g_usleep (HALF_SECOND);
- pixbuf = bacon_video_widget_get_current_frame (bvw);
- i++;
- } while (pixbuf == NULL && i < 20);
+ pixbuf = bacon_video_widget_get_current_frame (bvw);
/* Cleanup */
bacon_video_widget_close (bvw);