After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 723134 - hlsdemux: Playback may not always start when using a file:// url because of racy EOS handling
hlsdemux: Playback may not always start when using a file:// url because of r...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal major
: 1.2.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-01-27 22:35 UTC by Duncan Palmer
Modified: 2014-02-04 16:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix; check downloader->priv->download->completed before waiting. (624 bytes, patch)
2014-01-27 22:35 UTC, Duncan Palmer
needs-work Details | Review
Updated fix - set downloader->priv->cancelled in gst_uri_downloader_bus_handler() (1.09 KB, patch)
2014-02-03 14:16 UTC, Duncan Palmer
committed Details | Review

Description Duncan Palmer 2014-01-27 22:35:12 UTC
Created attachment 267357 [details] [review]
Fix; check downloader->priv->download->completed before waiting.

We use hlsdemux with a file:// url, and have a change in place to set the file blocksize to 64k, rather than the default 4k. This change exposes a race in uridownloader; gst_uri_downloader_fetch_uri_with_range() races with EOS handling in gst_uri_downloader_sink_event(). We sometimes see the EOS event being raised, and the downloader->priv->cond condition then being missed by gst_uri_downloader_fetch_uri_with_range(), which hangs.

I've attached a fix.
Comment 1 Sebastian Dröge (slomo) 2014-01-29 19:44:39 UTC
Review of attachment 267357 [details] [review]:

::: gst-libs/gst/uridownloader/gsturidownloader.c
@@ +413,3 @@
   GST_DEBUG_OBJECT (downloader, "Waiting to fetch the URI %s", uri);
+  while (!downloader->priv->cancelled && !downloader->priv->download->completed)
+    g_cond_wait (&downloader->priv->cond, GST_OBJECT_GET_LOCK (downloader));

This will break with the g_cond_signal() in gst_uri_downloader_bus_handler which does not set any of the two variables. I think it should set cancelled :)
Comment 2 Duncan Palmer 2014-02-03 14:16:46 UTC
Created attachment 267956 [details] [review]
Updated fix - set downloader->priv->cancelled in gst_uri_downloader_bus_handler()

Good point. Latest patch addresses this.
Comment 3 Sebastian Dröge (slomo) 2014-02-04 11:53:27 UTC
commit 06dd8839f4c9e8924221834a6125ef47744c86ed
Author: Duncan Palmer <dpalmer@digisoft.tv>
Date:   Tue Feb 4 12:52:25 2014 +0100

    uridownloader: Fix race condition between EOS handling and downloading a range
    
    https://bugzilla.gnome.org/show_bug.cgi?id=723134