mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-22 14:06:23 +00:00
splitmuxsink: Be less strict about queueing negative durations
In case of temporary backwards timestamps durations can become negative. Instead of erroring out, simply clip the durations and warn. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8390>
This commit is contained in:
parent
f25668a223
commit
f6cc65a6bc
1 changed files with 12 additions and 17 deletions
|
@ -2669,11 +2669,19 @@ handle_gathered_gop (GstSplitMuxSink * splitmux, const InputGop * gop,
|
||||||
GST_STIME_ARGS (queued_time), queued_bytes,
|
GST_STIME_ARGS (queued_time), queued_bytes,
|
||||||
GST_STIME_ARGS (next_gop_start_time), GST_STIME_ARGS (gop->start_time));
|
GST_STIME_ARGS (next_gop_start_time), GST_STIME_ARGS (gop->start_time));
|
||||||
|
|
||||||
if (queued_gop_time < 0)
|
if (queued_gop_time < 0) {
|
||||||
goto error_gop_duration;
|
GST_WARNING_OBJECT (splitmux,
|
||||||
|
"Queued GOP time is negative %" GST_STIME_FORMAT,
|
||||||
|
-GST_STIME_ARGS (queued_gop_time));
|
||||||
|
queued_gop_time = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (queued_time < splitmux->fragment_start_time)
|
if (queued_time < splitmux->fragment_start_time) {
|
||||||
goto error_queued_time;
|
GST_WARNING_OBJECT (splitmux,
|
||||||
|
"Queued time is negative. Input went backwards. queued_time - %"
|
||||||
|
GST_STIME_FORMAT, GST_STIME_ARGS (queued_time));
|
||||||
|
queued_time = splitmux->fragment_start_time;
|
||||||
|
}
|
||||||
|
|
||||||
queued_time -= splitmux->fragment_start_time;
|
queued_time -= splitmux->fragment_start_time;
|
||||||
if (queued_time < queued_gop_time)
|
if (queued_time < queued_gop_time)
|
||||||
|
@ -2743,19 +2751,6 @@ handle_gathered_gop (GstSplitMuxSink * splitmux, const InputGop * gop,
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
error_gop_duration:
|
|
||||||
GST_ELEMENT_ERROR (splitmux,
|
|
||||||
STREAM, FAILED, ("Timestamping error on input streams"),
|
|
||||||
("Queued GOP time is negative %" GST_STIME_FORMAT,
|
|
||||||
GST_STIME_ARGS (queued_gop_time)));
|
|
||||||
return;
|
|
||||||
error_queued_time:
|
|
||||||
GST_ELEMENT_ERROR (splitmux,
|
|
||||||
STREAM, FAILED, ("Timestamping error on input streams"),
|
|
||||||
("Queued time is negative. Input went backwards. queued_time - %"
|
|
||||||
GST_STIME_FORMAT, GST_STIME_ARGS (queued_time)));
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Called with splitmux lock held */
|
/* Called with splitmux lock held */
|
||||||
|
|
Loading…
Reference in a new issue