summaryrefslogtreecommitdiff
path: root/gst-libs/gst/uridownloader
diff options
context:
space:
mode:
authorDuncan Palmer <dpalmer@digisoft.tv>2014-02-04 12:52:25 +0100
committerSebastian Dröge <sebastian@centricular.com>2014-02-04 12:53:00 +0100
commit06dd8839f4c9e8924221834a6125ef47744c86ed (patch)
tree33dca53abf7e4d59e017a417ad4e2f975ab0660f /gst-libs/gst/uridownloader
parent2ae5adfd539cd080d76a5dd81a4e23388a6cbae7 (diff)
downloadgstreamer-plugins-bad-06dd8839f4c9e8924221834a6125ef47744c86ed.tar.gz
uridownloader: Fix race condition between EOS handling and downloading a range
https://bugzilla.gnome.org/show_bug.cgi?id=723134
Diffstat (limited to 'gst-libs/gst/uridownloader')
-rw-r--r--gst-libs/gst/uridownloader/gsturidownloader.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gst-libs/gst/uridownloader/gsturidownloader.c b/gst-libs/gst/uridownloader/gsturidownloader.c
index 3c6dbc9e2..afd4c3e3a 100644
--- a/gst-libs/gst/uridownloader/gsturidownloader.c
+++ b/gst-libs/gst/uridownloader/gsturidownloader.c
@@ -210,6 +210,7 @@ gst_uri_downloader_bus_handler (GstBus * bus,
GST_DEBUG_OBJECT (downloader, "Stopping download");
g_object_unref (downloader->priv->download);
downloader->priv->download = NULL;
+ downloader->priv->cancelled = TRUE;
g_cond_signal (&downloader->priv->cond);
}
GST_OBJECT_UNLOCK (downloader);
@@ -409,7 +410,8 @@ gst_uri_downloader_fetch_uri_with_range (GstUriDownloader * downloader,
* - the download was canceled
*/
GST_DEBUG_OBJECT (downloader, "Waiting to fetch the URI %s", uri);
- g_cond_wait (&downloader->priv->cond, GST_OBJECT_GET_LOCK (downloader));
+ while (!downloader->priv->cancelled && !downloader->priv->download->completed)
+ g_cond_wait (&downloader->priv->cond, GST_OBJECT_GET_LOCK (downloader));
if (downloader->priv->cancelled) {
if (downloader->priv->download) {