diff --git a/plugins/elements/gstdownloadbuffer.c b/plugins/elements/gstdownloadbuffer.c index 6f67e78b63..2bdc43de57 100644 --- a/plugins/elements/gstdownloadbuffer.c +++ b/plugins/elements/gstdownloadbuffer.c @@ -703,9 +703,15 @@ gst_download_buffer_wait_for_data (GstDownloadBuffer * dlbuf, guint64 offset, } } - if (dlbuf->write_pos != offset) + if (dlbuf->write_pos != offset) { perform_seek_to_offset (dlbuf, offset); + /* perform_seek_to_offset() releases the lock, so we may have been flushed + * during the call. */ + if (dlbuf->srcresult == GST_FLOW_FLUSHING) + goto out_flushing; + } + dlbuf->filling = TRUE; if (dlbuf->write_pos > dlbuf->read_pos) update_levels (dlbuf, dlbuf->write_pos - dlbuf->read_pos);