mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-22 17:51:16 +00:00
basesrc: Retry create() if we are back from pause
After a create() call, which may have returned FLUSHING or a filled buffer, if it possible that we detect that we are now in pause. As live sourced don't produce data in pause, drop the buffer is any and later retry creating a buffer. This will ensure that we resume from pause while avoiding displaying ancient frame. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4961>
This commit is contained in:
parent
e506f9c23e
commit
47d79eedc9
1 changed files with 8 additions and 2 deletions
|
@ -2588,6 +2588,7 @@ again:
|
||||||
res_buf = in_buf = *buf;
|
res_buf = in_buf = *buf;
|
||||||
own_res_buf = (*buf == NULL);
|
own_res_buf = (*buf == NULL);
|
||||||
|
|
||||||
|
retry_create:
|
||||||
GST_LIVE_UNLOCK (src);
|
GST_LIVE_UNLOCK (src);
|
||||||
ret = bclass->create (src, offset, length, &res_buf);
|
ret = bclass->create (src, offset, length, &res_buf);
|
||||||
GST_LIVE_LOCK (src);
|
GST_LIVE_LOCK (src);
|
||||||
|
@ -2596,13 +2597,18 @@ again:
|
||||||
if (src->is_live) {
|
if (src->is_live) {
|
||||||
if (G_UNLIKELY (!src->live_running)) {
|
if (G_UNLIKELY (!src->live_running)) {
|
||||||
GstFlowReturn wait_ret;
|
GstFlowReturn wait_ret;
|
||||||
wait_ret = gst_base_src_wait_playing_unlocked (src);
|
|
||||||
if (wait_ret != GST_FLOW_OK) {
|
/* no need keep old buffer while in pause */
|
||||||
if (ret == GST_FLOW_OK && own_res_buf)
|
if (ret == GST_FLOW_OK && own_res_buf)
|
||||||
gst_buffer_unref (res_buf);
|
gst_buffer_unref (res_buf);
|
||||||
|
|
||||||
|
wait_ret = gst_base_src_wait_playing_unlocked (src);
|
||||||
|
if (wait_ret != GST_FLOW_OK) {
|
||||||
ret = wait_ret;
|
ret = wait_ret;
|
||||||
goto stopped;
|
goto stopped;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
goto retry_create;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue