downloadbuffer: does not recover from failed seek
Submitted by Alicia Boya García
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_DEBUG_OBJECT (dlbuf, "Seeking to %" G_GUINT64_FORMAT, offset);
gst_event_new_seek (1.0, GST_FORMAT_BYTES,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE, GST_SEEK_TYPE_SET, offset,
res = gst_pad_push_event (dlbuf->sinkpad, event);
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 */
(and downloadbuffer falsely believes the seek went through)