diff options
author | Philip Withnall <philip@tecnocode.co.uk> | 2010-04-16 19:54:06 +0100 |
---|---|---|
committer | Philip Withnall <philip@tecnocode.co.uk> | 2010-04-19 13:00:25 +0100 |
commit | 540aaa7a104de22128218dd96be2c1078d2a3f8c (patch) | |
tree | 13a939cef44ed856c79e619418b6e5bb288aa229 | |
parent | 376f92f60f2fa7e695bdd472d0a9b9f298a300d8 (diff) | |
download | totem-540aaa7a104de22128218dd96be2c1078d2a3f8c.tar.gz |
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
-rw-r--r-- | configure.in | 7 | ||||
-rw-r--r-- | src/plugins/youtube/totem-youtube.c | 6 |
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); |