Commit 4c3c2241 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

plugins/elements/gstidentity.c: Print additional debug info when the stream...

plugins/elements/gstidentity.c: Print additional debug info when the stream isn't perfectly timestamped; don't try to...

Original commit message from CVS:
* plugins/elements/gstidentity.c: (gst_identity_check_perfect):
Print additional debug info when the stream isn't perfectly
timestamped; don't try to use invalid durations.
parent 85d32512
2006-12-16 Tim-Philipp Müller <tim at centricular dot net>
* plugins/elements/gstidentity.c: (gst_identity_check_perfect):
Print additional debug info when the stream isn't perfectly
timestamped; don't try to use invalid durations.
2006-12-16 Tim-Philipp Müller <tim at centricular dot net> 2006-12-16 Tim-Philipp Müller <tim at centricular dot net>
* docs/design/Makefile.am: * docs/design/Makefile.am:
......
...@@ -318,15 +318,22 @@ gst_identity_check_perfect (GstIdentity * identity, GstBuffer * buf) ...@@ -318,15 +318,22 @@ gst_identity_check_perfect (GstIdentity * identity, GstBuffer * buf)
/* invalid timestamp drops us out of check. FIXME: maybe warn ? */ /* invalid timestamp drops us out of check. FIXME: maybe warn ? */
if (timestamp != GST_CLOCK_TIME_NONE) { if (timestamp != GST_CLOCK_TIME_NONE) {
/* check if we had a previous buffer to compare to */ /* check if we had a previous buffer to compare to */
if (identity->prev_timestamp != GST_CLOCK_TIME_NONE) { if (identity->prev_timestamp != GST_CLOCK_TIME_NONE &&
guint64 offset; identity->prev_duration != GST_CLOCK_TIME_NONE) {
guint64 offset, t_expected;
if (identity->prev_timestamp + identity->prev_duration != timestamp) { gint64 dt;
t_expected = identity->prev_timestamp + identity->prev_duration;
dt = timestamp - t_expected;
if (dt != 0) {
GST_WARNING_OBJECT (identity, GST_WARNING_OBJECT (identity,
"Buffer not time-contiguous with previous one: " "prev ts %" "Buffer not time-contiguous with previous one: " "prev ts %"
GST_TIME_FORMAT ", prev dur %" GST_TIME_FORMAT ", new ts %" GST_TIME_FORMAT ", prev dur %" GST_TIME_FORMAT ", new ts %"
GST_TIME_FORMAT, GST_TIME_ARGS (identity->prev_timestamp), GST_TIME_FORMAT " (expected ts %" GST_TIME_FORMAT ", delta=%c%"
GST_TIME_ARGS (identity->prev_duration), GST_TIME_ARGS (timestamp)); GST_TIME_FORMAT ")", GST_TIME_ARGS (identity->prev_timestamp),
GST_TIME_ARGS (identity->prev_duration), GST_TIME_ARGS (timestamp),
GST_TIME_ARGS (t_expected), (dt < 0) ? '-' : '+',
GST_TIME_ARGS ((dt < 0) ? (GstClockTime) (-dt) : dt));
} }
offset = GST_BUFFER_OFFSET (buf); offset = GST_BUFFER_OFFSET (buf);
...@@ -336,7 +343,11 @@ gst_identity_check_perfect (GstIdentity * identity, GstBuffer * buf) ...@@ -336,7 +343,11 @@ gst_identity_check_perfect (GstIdentity * identity, GstBuffer * buf)
"prev offset_end %" G_GINT64_FORMAT ", new offset %" "prev offset_end %" G_GINT64_FORMAT ", new offset %"
G_GINT64_FORMAT, identity->prev_offset_end, offset); G_GINT64_FORMAT, identity->prev_offset_end, offset);
} }
} else {
GST_DEBUG_OBJECT (identity, "can't check time-contiguity, no timestamp "
"and/or duration were set on previous buffer");
} }
/* update prev values */ /* update prev values */
identity->prev_timestamp = timestamp; identity->prev_timestamp = timestamp;
identity->prev_duration = GST_BUFFER_DURATION (buf); identity->prev_duration = GST_BUFFER_DURATION (buf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment