[Bug 755226] dashdemux: download_finish variable is not reset safely

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon Sep 21 09:10:51 PDT 2015


https://bugzilla.gnome.org/show_bug.cgi?id=755226

--- Comment #4 from Florin Apostol <florin.apostol at oregan.net> ---
(In reply to Vincent Penquerc'h from comment #3)
> Seems OK, except for the last hunk, which I'm not sure why it needs
> resetting there.

I don't understand your question. As I described in the comment and in the bug
report, if the download_finished is not reset while the lock is taken, it
cannot be safely done later. The following scenario can occur:

Thread A: gst_adaptive_demux_stream_download_uri
g_cond_wait (&stream->fragment_download_cond,
       &stream->fragment_download_lock);        
g_mutex_unlock (&stream->fragment_download_lock);

...
                   Thread B tries to stop the stream:
                       g_mutex_lock (&stream->fragment_download_lock);
                       stream->download_finished = TRUE;
                       g_mutex_unlock (&stream->fragment_download_lock);
...

Thread A, sometime later, tries to reset download_finished and will overwrite
the stop request:
g_mutex_lock (&stream->fragment_download_lock);
stream->download_finished = FALSE;
g_mutex_unlock (&stream->fragment_download_lock);

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list