[totem] Bug 615506 — totem: Youtube Search lasts forever while playing Video



commit 540aaa7a104de22128218dd96be2c1078d2a3f8c
Author: Philip Withnall <philip tecnocode co uk>
Date:   Fri Apr 16 19:54:06 2010 +0100

    Bug 615506 â?? totem: Youtube Search lasts forever while playing Video
    
    Use a network timeout of 30 seconds if it's supported by the version of
    libgdata we're building against. This will error out of queries if they take
    longer than 30 seconds. Closes: bgo#615506

 configure.in                        |    7 +++++++
 src/plugins/youtube/totem-youtube.c |    6 ++++++
 2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/configure.in b/configure.in
index 64d544f..e297e60 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 2d8fc8f..61199bd 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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]