typefindhelper: fix confusing debug log message

In case of a short buffer, the debug log is quite confusing.
Distinguish the two types of failure cases to make it clearer.

https://bugzilla.gnome.org/show_bug.cgi?id=792486
This commit is contained in:
Jun Xie 2018-01-13 11:08:00 +08:00 committed by Tim-Philipp Müller
parent 968dd651c2
commit 33e7269c37

View file

@ -167,10 +167,16 @@ helper_find_peek (gpointer data, gint64 offset, guint size)
buf_offset = GST_BUFFER_OFFSET (buffer);
buf_size = gst_buffer_get_size (buffer);
if ((buf_offset != -1 && buf_offset != offset) || buf_size < size) {
GST_DEBUG ("dropping short buffer: %" G_GUINT64_FORMAT "-%" G_GUINT64_FORMAT
" instead of %" G_GUINT64_FORMAT "-%" G_GUINT64_FORMAT,
buf_offset, buf_offset + buf_size - 1, offset, offset + size - 1);
if (buf_size < size) {
GST_DEBUG ("dropping short buffer of size %" G_GSIZE_FORMAT ","
"requested size was %u", buf_size, size);
gst_buffer_unref (buffer);
return NULL;
}
if (buf_offset != -1 && buf_offset != offset) {
GST_DEBUG ("dropping buffer with unexpected offset %" G_GUINT64_FORMAT ", "
"expected offset was %" G_GUINT64_FORMAT, buf_offset, offset);
gst_buffer_unref (buffer);
return NULL;
}