[totem] backend: Remove error reporting from bvw_open()
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] backend: Remove error reporting from bvw_open()
- Date: Wed, 27 Mar 2013 22:12:45 +0000 (UTC)
commit 346754dc843a05594753806ecb51ae78bfa645c0
Author: Bastien Nocera <hadess hadess net>
Date: Wed Mar 27 23:11:32 2013 +0100
backend: Remove error reporting from bvw_open()
All the errors were reported async, through the error signal,
so the error reporting in bvw_open() was completely unused.
browser-plugin/totem-plugin-viewer.c | 5 ++---
src/backend/bacon-video-widget.c | 29 ++++++++---------------------
src/backend/bacon-video-widget.h | 5 ++---
src/backend/bvw-test.c | 2 +-
src/totem-object.c | 5 ++---
5 files changed, 15 insertions(+), 31 deletions(-)
---
diff --git a/browser-plugin/totem-plugin-viewer.c b/browser-plugin/totem-plugin-viewer.c
index a18151c..bb89d4a 100644
--- a/browser-plugin/totem-plugin-viewer.c
+++ b/browser-plugin/totem-plugin-viewer.c
@@ -376,7 +376,6 @@ totem_embedded_open_internal (TotemEmbedded *emb,
gboolean start_play,
GError **error)
{
- gboolean retval;
char *uri;
/* FIXME: stop previous content, or is that automatic ? */
@@ -405,7 +404,7 @@ totem_embedded_open_internal (TotemEmbedded *emb,
bacon_video_widget_set_logo_mode (emb->bvw, FALSE);
- retval = bacon_video_widget_open (emb->bvw, uri, NULL);
+ bacon_video_widget_open (emb->bvw, uri);
bacon_video_widget_set_text_subtitle (emb->bvw, emb->current_subtitle_uri);
g_free (uri);
@@ -421,7 +420,7 @@ totem_embedded_open_internal (TotemEmbedded *emb,
else
totem_fullscreen_set_title (emb->fs, emb->current_uri);
- return retval;
+ return TRUE;
}
static gboolean
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c
index d91b1f8..3c2a005 100644
--- a/src/backend/bacon-video-widget.c
+++ b/src/backend/bacon-video-widget.c
@@ -1280,12 +1280,7 @@ mount_cb (GObject *obj, GAsyncResult *res, gpointer user_data)
GST_DEBUG ("Mounting location '%s' successful", GST_STR_NULL (uri));
/* Save the expected pipeline state */
target_state = bvw->priv->target_state;
- if (bacon_video_widget_open (bvw, uri, &error)) {
- if (target_state == GST_STATE_PLAYING)
- bacon_video_widget_play (bvw, NULL);
- g_free (uri);
- return;
- }
+ bacon_video_widget_open (bvw, uri);
}
if (!ret)
@@ -3553,27 +3548,21 @@ get_target_uri (GFile *file)
* bacon_video_widget_open:
* @bvw: a #BaconVideoWidget
* @mrl: an MRL
- * @error: a #GError, or %NULL
*
* Opens the given @mrl in @bvw for playing.
*
- * If there was a filesystem error, a %BVW_ERROR_GENERIC error will be returned. Otherwise,
- * more specific #BvwError errors will be returned.
- *
- * On success, the MRL is loaded and waiting to be played with bacon_video_widget_play().
- *
- * Return value: %TRUE on success, %FALSE otherwise
+ * The MRL is loaded and waiting to be played with bacon_video_widget_play().
**/
-gboolean
-bacon_video_widget_open (BaconVideoWidget * bvw,
- const gchar * mrl, GError ** error)
+void
+bacon_video_widget_open (BaconVideoWidget *bvw,
+ const char *mrl)
{
GFile *file;
char *path;
- g_return_val_if_fail (mrl != NULL, FALSE);
- g_return_val_if_fail (BACON_IS_VIDEO_WIDGET (bvw), FALSE);
- g_return_val_if_fail (bvw->priv->play != NULL, FALSE);
+ g_return_if_fail (mrl != NULL);
+ g_return_if_fail (BACON_IS_VIDEO_WIDGET (bvw));
+ g_return_if_fail (bvw->priv->play != NULL);
/* So we aren't closed yet... */
if (bvw->priv->mrl) {
@@ -3633,8 +3622,6 @@ bacon_video_widget_open (BaconVideoWidget * bvw,
gst_element_set_state (bvw->priv->play, GST_STATE_PAUSED);
g_signal_emit (bvw, bvw_signals[SIGNAL_CHANNELS_CHANGE], 0);
-
- return TRUE;
}
/**
diff --git a/src/backend/bacon-video-widget.h b/src/backend/bacon-video-widget.h
index bf2f5c7..1b305b6 100644
--- a/src/backend/bacon-video-widget.h
+++ b/src/backend/bacon-video-widget.h
@@ -129,9 +129,8 @@ GOptionGroup* bacon_video_widget_get_option_group (void);
GtkWidget *bacon_video_widget_new (GError **error);
/* Actions */
-gboolean bacon_video_widget_open (BaconVideoWidget *bvw,
- const char *mrl,
- GError **error);
+void bacon_video_widget_open (BaconVideoWidget *bvw,
+ const char *mrl);
gboolean bacon_video_widget_play (BaconVideoWidget *bvw,
GError **error);
void bacon_video_widget_pause (BaconVideoWidget *bvw);
diff --git a/src/backend/bvw-test.c b/src/backend/bvw-test.c
index deee2a6..477a962 100644
--- a/src/backend/bvw-test.c
+++ b/src/backend/bvw-test.c
@@ -16,7 +16,7 @@ static void
test_bvw_set_mrl (GtkWidget *bvw, const char *path)
{
mrl = g_strdup (path);
- bacon_video_widget_open (BACON_VIDEO_WIDGET (bvw), mrl, NULL);
+ bacon_video_widget_open (BACON_VIDEO_WIDGET (bvw), mrl);
}
static void
diff --git a/src/totem-object.c b/src/totem-object.c
index 3998866..bc95794 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -1651,7 +1651,6 @@ totem_action_set_mrl (TotemObject *totem,
gdouble volume;
char *user_agent;
char *autoload_sub;
- GError *err = NULL;
bacon_video_widget_set_logo_mode (totem->bvw, FALSE);
@@ -1665,7 +1664,7 @@ totem_action_set_mrl (TotemObject *totem,
g_free (user_agent);
totem_gdk_window_set_waiting_cursor (gtk_widget_get_window (totem->win));
- bacon_video_widget_open (totem->bvw, mrl, &err);
+ bacon_video_widget_open (totem->bvw, mrl);
bacon_video_widget_set_text_subtitle (totem->bvw, subtitle ? subtitle : autoload_sub);
g_free (autoload_sub);
gdk_window_set_cursor (gtk_widget_get_window (totem->win), NULL);
@@ -2230,7 +2229,7 @@ on_got_redirect (BaconVideoWidget *bvw, const char *mrl, TotemObject *totem)
totem_file_closed (totem);
totem->has_played_emitted = FALSE;
totem_gdk_window_set_waiting_cursor (gtk_widget_get_window (totem->win));
- bacon_video_widget_open (totem->bvw, new_mrl ? new_mrl : mrl, NULL);
+ bacon_video_widget_open (totem->bvw, new_mrl ? new_mrl : mrl);
totem_file_opened (totem, new_mrl ? new_mrl : mrl);
gdk_window_set_cursor (gtk_widget_get_window (totem->win), NULL);
if (bacon_video_widget_play (bvw, NULL) != FALSE) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]