summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.in7
-rw-r--r--src/plugins/youtube/totem-youtube.c6
2 files changed, 13 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 64d544fbe..e297e608d 100644
--- a/configure.in
+++ b/configure.in
@@ -545,6 +545,13 @@ for plugin in ${used_plugins}; do
add_plugin="0"
fi
+ # For timeout support. Remove this once we depend on libgdata >= 0.7.0
+ PKG_CHECK_MODULES(LIBGDATA_0_7, libgdata >= 0.7.0,
+ [HAVE_LIBGDATA_0_7=yes], [HAVE_LIBGDATA_0_7=no])
+ if test "${HAVE_LIBGDATA_0_7}" = "yes" ; then
+ AC_DEFINE([HAVE_LIBGDATA_0_7],[1],[Define if libgdata >= 0.7.0 is available])
+ fi
+
dnl We need the souphttpsrc element for the YouTube plugin
AC_MSG_CHECKING([GStreamer 0.10 souphttpsrc plugin])
if $gst010_inspect souphttpsrc >/dev/null 2>/dev/null; then
diff --git a/src/plugins/youtube/totem-youtube.c b/src/plugins/youtube/totem-youtube.c
index 2d8fc8f29..61199bd4e 100644
--- a/src/plugins/youtube/totem-youtube.c
+++ b/src/plugins/youtube/totem-youtube.c
@@ -860,6 +860,12 @@ search_button_clicked_cb (GtkButton *button, TotemYouTubePlugin *self)
/* Set up the GData service (needed for the tree views' queries) */
self->service = gdata_youtube_service_new (DEVELOPER_KEY, CLIENT_ID);
+ /* Set up network timeouts, if they're supported by our version of libgdata.
+ * This will return from queries with %GDATA_SERVICE_ERROR_NETWORK_ERROR if network operations take longer than 30 seconds. */
+#ifdef HAVE_LIBGDATA_0_7
+ gdata_service_set_timeout (GDATA_SERVICE (self->service), 30);
+#endif /* HAVE_LIBGDATA_0_7 */
+
/* Set up the queries */
self->query[SEARCH_TREE_VIEW] = gdata_query_new_with_limits (NULL, 0, MAX_RESULTS);
self->query[RELATED_TREE_VIEW] = gdata_query_new_with_limits (NULL, 0, MAX_RESULTS);