mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
pad-monitor: Handle out-of-segment first buffer
If the initial buffer is before segment.start, we don't want to raise the "first buffer doesn't have 0 running-time" issue. Also add debug for tracking issues
This commit is contained in:
parent
ca44a11429
commit
0693805e9c
1 changed files with 11 additions and 1 deletions
|
@ -823,10 +823,17 @@ gst_validate_pad_monitor_check_first_buffer (GstValidatePadMonitor *
|
|||
GST_VALIDATE_REPORT (pad_monitor, BUFFER_BEFORE_SEGMENT,
|
||||
"Received buffer before Segment event");
|
||||
}
|
||||
|
||||
GST_DEBUG_OBJECT (pad_monitor->pad,
|
||||
"Checking first buffer (pts:%" GST_TIME_FORMAT " dts:%" GST_TIME_FORMAT
|
||||
")", GST_TIME_ARGS (GST_BUFFER_PTS (buffer)),
|
||||
GST_TIME_ARGS (GST_BUFFER_DTS (buffer)));
|
||||
|
||||
if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (buffer))) {
|
||||
gint64 running_time = gst_segment_to_running_time (&pad_monitor->segment,
|
||||
pad_monitor->segment.format, GST_BUFFER_TIMESTAMP (buffer));
|
||||
if (running_time != 0) {
|
||||
/* Only check for in-segment buffers */
|
||||
if (GST_CLOCK_TIME_IS_VALID (running_time) && running_time != 0) {
|
||||
GST_VALIDATE_REPORT (pad_monitor, FIRST_BUFFER_RUNNING_TIME_IS_NOT_ZERO,
|
||||
"First buffer running time is not 0, it is: %" GST_TIME_FORMAT,
|
||||
GST_TIME_ARGS (running_time));
|
||||
|
@ -1281,6 +1288,9 @@ gst_validate_pad_monitor_downstream_event_check (GstValidatePadMonitor *
|
|||
/* parse segment data to be used if event is handled */
|
||||
gst_event_parse_segment (event, &segment);
|
||||
|
||||
GST_DEBUG_OBJECT (pad_monitor->pad, "Got segment %" GST_SEGMENT_FORMAT,
|
||||
segment);
|
||||
|
||||
if (pad_monitor->pending_newsegment_seqnum) {
|
||||
if (pad_monitor->pending_newsegment_seqnum == seqnum) {
|
||||
pad_monitor->pending_newsegment_seqnum = 0;
|
||||
|
|
Loading…
Reference in a new issue