downloadbuffer:fix pushing buffer before stream start event

downloadbuffer source pad pushes the first buffer before pushing
Stream Start and Segment event, when working in Push mode.

Fix:Pushing Stream Start and Segment after coming out of
wait for data, and before pushing the buffer to next element.

Fixes #534
This commit is contained in:
dhilshad 2020-04-17 11:44:40 +05:30 committed by Mohammed Dhilshad
parent ab8674d503
commit c8bcb9db18

View file

@ -1317,6 +1317,10 @@ gst_download_buffer_loop (GstPad * pad)
/* have to lock for thread-safety */
GST_DOWNLOAD_BUFFER_MUTEX_LOCK_CHECK (dlbuf, dlbuf->srcresult, out_flushing);
ret = gst_download_buffer_read_buffer (dlbuf, -1, -1, &buffer);
if (ret != GST_FLOW_OK)
goto out_flushing;
if (dlbuf->stream_start_event != NULL) {
gst_pad_push_event (dlbuf->srcpad, dlbuf->stream_start_event);
dlbuf->stream_start_event = NULL;
@ -1326,9 +1330,6 @@ gst_download_buffer_loop (GstPad * pad)
dlbuf->segment_event = NULL;
}
ret = gst_download_buffer_read_buffer (dlbuf, -1, -1, &buffer);
if (ret != GST_FLOW_OK)
goto out_flushing;
/* update the buffering */
msg = update_buffering (dlbuf);