mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
downloadbuffer: Don't hold the mutex while posint the download-complete message
Something might handle it from a sync message handler and call back into downloadbuffer, causing a deadlock.
This commit is contained in:
parent
70104857b0
commit
d431ef7190
1 changed files with 6 additions and 6 deletions
|
@ -1277,19 +1277,19 @@ write_error:
|
||||||
}
|
}
|
||||||
completed:
|
completed:
|
||||||
{
|
{
|
||||||
|
GstMessage *complete_message;
|
||||||
|
|
||||||
GST_LOG_OBJECT (dlbuf, "we completed the download");
|
GST_LOG_OBJECT (dlbuf, "we completed the download");
|
||||||
dlbuf->write_pos = dlbuf->upstream_size;
|
dlbuf->write_pos = dlbuf->upstream_size;
|
||||||
dlbuf->filling = FALSE;
|
dlbuf->filling = FALSE;
|
||||||
update_levels (dlbuf, dlbuf->max_level.bytes);
|
update_levels (dlbuf, dlbuf->max_level.bytes);
|
||||||
msg = update_buffering (dlbuf);
|
msg = update_buffering (dlbuf);
|
||||||
|
complete_message = gst_message_new_element (GST_OBJECT_CAST (dlbuf),
|
||||||
gst_element_post_message (GST_ELEMENT_CAST (dlbuf),
|
gst_structure_new ("GstCacheDownloadComplete",
|
||||||
gst_message_new_element (GST_OBJECT_CAST (dlbuf),
|
"location", G_TYPE_STRING, dlbuf->temp_location, NULL));
|
||||||
gst_structure_new ("GstCacheDownloadComplete",
|
|
||||||
"location", G_TYPE_STRING, dlbuf->temp_location, NULL)));
|
|
||||||
|
|
||||||
GST_DOWNLOAD_BUFFER_MUTEX_UNLOCK (dlbuf);
|
GST_DOWNLOAD_BUFFER_MUTEX_UNLOCK (dlbuf);
|
||||||
|
|
||||||
|
gst_element_post_message (GST_ELEMENT_CAST (dlbuf), complete_message);
|
||||||
if (msg != NULL)
|
if (msg != NULL)
|
||||||
gst_element_post_message (GST_ELEMENT_CAST (dlbuf), msg);
|
gst_element_post_message (GST_ELEMENT_CAST (dlbuf), msg);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue