GNOME Bugzilla – Bug 723134
hlsdemux: Playback may not always start when using a file:// url because of racy EOS handling
Last modified: 2014-02-04 16:26:14 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.
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 :)
Created attachment 267956 [details] [review] Updated fix - set downloader->priv->cancelled in gst_uri_downloader_bus_handler() Good point. Latest patch addresses this.
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