diff options
author | Edward Hervey <edward@centricular.com> | 2020-11-09 11:41:10 +0100 |
---|---|---|
committer | GStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2020-12-04 08:09:58 +0000 |
commit | 30518de51df3e3c31168196e88dc155bb1c4606f (patch) | |
tree | 1cd8a871a1527facd3c0205683375536e33d01a1 /ext | |
parent | 0940d1b5b1df164a06a53a0fe8e7135a6b71ad79 (diff) | |
download | gstreamer-plugins-bad-30518de51df3e3c31168196e88dc155bb1c4606f.tar.gz |
adaptivedemux: Store QoS values on the element
Storing it per-stream requires taking the manifest lock which can apparenly be
hold for aeons. And since the QoS event comes from the video rendering thread
we *really* do not want to do that.
Storing it as-is in the element is fine, the important part is knowing the
earliest time downstream.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1819>
Diffstat (limited to 'ext')
-rw-r--r-- | ext/dash/gstdashdemux.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c index 8aecfafa4..93980b040 100644 --- a/ext/dash/gstdashdemux.c +++ b/ext/dash/gstdashdemux.c @@ -218,8 +218,7 @@ * GstDashDemuxStream->actual_position. * * The downstream position of the pipeline is obtained via QoS events and - * is stored in GstAdaptiveDemuxStream->qos_earliest_time (note: it's a - * running time value). + * is stored in GstAdaptiveDemux (note: it's a running time value). * * The estimated buffering level between dashdemux and downstream is * therefore: @@ -1764,6 +1763,7 @@ gst_dash_demux_stream_get_target_time (GstDashDemux * dashdemux, GstClockTimeDiff diff; GstClockTime ret = cur_position; GstClockTime deadline; + GstClockTime upstream_earliest_time; GstClockTime earliest_time = GST_CLOCK_TIME_NONE; g_assert (min_skip > 0); @@ -1785,7 +1785,9 @@ gst_dash_demux_stream_get_target_time (GstDashDemux * dashdemux, * flush, as otherwise base_time and clock might not be correct because of a * still pre-rolling sink */ - if (stream->qos_earliest_time != GST_CLOCK_TIME_NONE) { + upstream_earliest_time = + gst_adaptive_demux_get_qos_earliest_time ((GstAdaptiveDemux *) dashdemux); + if (upstream_earliest_time != GST_CLOCK_TIME_NONE) { GstClock *clock; clock = gst_element_get_clock (GST_ELEMENT_CAST (dashdemux)); @@ -1803,9 +1805,9 @@ gst_dash_demux_stream_get_target_time (GstDashDemux * dashdemux, gst_object_unref (clock); - earliest_time = MAX (now_time, stream->qos_earliest_time); + earliest_time = MAX (now_time, upstream_earliest_time); } else { - earliest_time = stream->qos_earliest_time; + earliest_time = upstream_earliest_time; } } |