downloadbuffer: does not recover from failed seek
@ntrrgc
Submitted by Alicia Boya García Link to original bug (#797098)
Description
This is some code from perform_seek_to_offset() from gstdownloadbuffer.c
/* until we receive the FLUSH_STOP from this seek, we skip data */
dlbuf->seeking = TRUE;
dlbuf->write_pos = offset;
dlbuf->filling = FALSE;
GST_DOWNLOAD_BUFFER_MUTEX_UNLOCK (dlbuf);
GST_DEBUG_OBJECT (dlbuf, "Seeking to %" G_GUINT64_FORMAT, offset);
event =
gst_event_new_seek (1.0, GST_FORMAT_BYTES,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE, GST_SEEK_TYPE_SET, offset,
GST_SEEK_TYPE_NONE, -1);
res = gst_pad_push_event (dlbuf->sinkpad, event);
GST_DOWNLOAD_BUFFER_MUTEX_LOCK (dlbuf);
return res;
Problem is: what happens if the seek fails? write_pos
has already been set to the attempted seek position.
What I've seen happening next is that then downloadbuffer waits endlessly for that data with the offset of the seek to arrive; which never happens because gst_download_buffer_chain() has this check:
/* while we didn't receive the newsegment, we're seeking and we skip data */
if (dlbuf->seeking)
goto out_seeking;
(and downloadbuffer falsely believes the seek went through)