mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 19:21:06 +00:00
mpegtsmux: Wait for data on all pads before deciding on a best pad unless timing out
This makes sure that if upstream has different latencies that we're still outputting buffers with increasining timestamps across the different streams unless buffers are arriving after the latency deadline. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7516>
This commit is contained in:
parent
ca23c3c762
commit
7c7ac2d84f
1 changed files with 9 additions and 3 deletions
|
@ -2449,7 +2449,7 @@ beach:
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstBaseTsMuxPad *
|
static GstBaseTsMuxPad *
|
||||||
gst_base_ts_mux_find_best_pad (GstAggregator * aggregator)
|
gst_base_ts_mux_find_best_pad (GstAggregator * aggregator, gboolean timeout)
|
||||||
{
|
{
|
||||||
GstBaseTsMuxPad *best = NULL;
|
GstBaseTsMuxPad *best = NULL;
|
||||||
GstClockTime best_ts = GST_CLOCK_TIME_NONE;
|
GstClockTime best_ts = GST_CLOCK_TIME_NONE;
|
||||||
|
@ -2463,8 +2463,14 @@ gst_base_ts_mux_find_best_pad (GstAggregator * aggregator)
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
|
|
||||||
buffer = gst_aggregator_pad_peek_buffer (apad);
|
buffer = gst_aggregator_pad_peek_buffer (apad);
|
||||||
if (!buffer)
|
if (!buffer) {
|
||||||
|
if (!timeout && !GST_PAD_IS_EOS (apad)) {
|
||||||
|
gst_object_replace ((GstObject **) & best, NULL);
|
||||||
|
best_ts = GST_CLOCK_TIME_NONE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
if (best_ts == GST_CLOCK_TIME_NONE) {
|
if (best_ts == GST_CLOCK_TIME_NONE) {
|
||||||
best = tpad;
|
best = tpad;
|
||||||
best_ts = GST_BUFFER_DTS_OR_PTS (buffer);
|
best_ts = GST_BUFFER_DTS_OR_PTS (buffer);
|
||||||
|
@ -2518,7 +2524,7 @@ gst_base_ts_mux_aggregate (GstAggregator * agg, gboolean timeout)
|
||||||
{
|
{
|
||||||
GstBaseTsMux *mux = GST_BASE_TS_MUX (agg);
|
GstBaseTsMux *mux = GST_BASE_TS_MUX (agg);
|
||||||
GstFlowReturn ret = GST_FLOW_OK;
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
GstBaseTsMuxPad *best = gst_base_ts_mux_find_best_pad (agg);
|
GstBaseTsMuxPad *best = gst_base_ts_mux_find_best_pad (agg, timeout);
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
|
||||||
/* set caps on the srcpad if no caps were set yet */
|
/* set caps on the srcpad if no caps were set yet */
|
||||||
|
|
Loading…
Reference in a new issue