mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-22 03:50:12 +00:00
fix issue in buffer_store_get_size spanning multiple buffers, include more checks/debugging while doing so
Original commit message from CVS: fix issue in buffer_store_get_size spanning multiple buffers, include more checks/debugging while doing so
This commit is contained in:
parent
08337d5a24
commit
9bd630797f
6 changed files with 30 additions and 6 deletions
|
@ -51,6 +51,18 @@ static void gst_buffer_store_cleared_func (GstBufferStore * store);
|
|||
static GObjectClass *parent_class = NULL;
|
||||
static guint gst_buffer_store_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
G_GNUC_UNUSED static void
|
||||
debug_buffers (GstBufferStore *store)
|
||||
{
|
||||
GList *walk = store->buffers;
|
||||
|
||||
g_printerr ("BUFFERS in store:\n");
|
||||
while (walk) {
|
||||
g_print ("%15"G_GUINT64_FORMAT" - %7u\n", GST_BUFFER_OFFSET (walk->data), GST_BUFFER_SIZE (walk->data));
|
||||
walk = g_list_next (walk);
|
||||
}
|
||||
g_printerr ("\n");
|
||||
}
|
||||
GType
|
||||
gst_buffer_store_get_type (void)
|
||||
{
|
||||
|
@ -424,11 +436,11 @@ gst_buffer_store_get_size (GstBufferStore *store, guint64 offset)
|
|||
cur_offset = 0;
|
||||
}
|
||||
while (walk) {
|
||||
current = GST_BUFFER (walk->data);
|
||||
if (have_offset && counting &&
|
||||
cur_offset + GST_BUFFER_SIZE (current) != GST_BUFFER_OFFSET (walk->data)) {
|
||||
break;
|
||||
}
|
||||
current = GST_BUFFER (walk->data);
|
||||
if (have_offset) {
|
||||
cur_offset = GST_BUFFER_OFFSET (current);
|
||||
}
|
||||
|
@ -451,5 +463,3 @@ gst_buffer_store_get_size (GstBufferStore *store, guint64 offset)
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -331,6 +331,7 @@ static void
|
|||
start_typefinding (GstTypeFindElement *typefind)
|
||||
{
|
||||
g_assert (typefind->caps == NULL);
|
||||
g_assert (typefind->possibilities == NULL);
|
||||
|
||||
GST_DEBUG_OBJECT (typefind, "starting typefinding");
|
||||
typefind->mode = MODE_TYPEFIND;
|
||||
|
|
|
@ -331,6 +331,7 @@ static void
|
|||
start_typefinding (GstTypeFindElement *typefind)
|
||||
{
|
||||
g_assert (typefind->caps == NULL);
|
||||
g_assert (typefind->possibilities == NULL);
|
||||
|
||||
GST_DEBUG_OBJECT (typefind, "starting typefinding");
|
||||
typefind->mode = MODE_TYPEFIND;
|
||||
|
|
|
@ -51,6 +51,18 @@ static void gst_buffer_store_cleared_func (GstBufferStore * store);
|
|||
static GObjectClass *parent_class = NULL;
|
||||
static guint gst_buffer_store_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
G_GNUC_UNUSED static void
|
||||
debug_buffers (GstBufferStore *store)
|
||||
{
|
||||
GList *walk = store->buffers;
|
||||
|
||||
g_printerr ("BUFFERS in store:\n");
|
||||
while (walk) {
|
||||
g_print ("%15"G_GUINT64_FORMAT" - %7u\n", GST_BUFFER_OFFSET (walk->data), GST_BUFFER_SIZE (walk->data));
|
||||
walk = g_list_next (walk);
|
||||
}
|
||||
g_printerr ("\n");
|
||||
}
|
||||
GType
|
||||
gst_buffer_store_get_type (void)
|
||||
{
|
||||
|
@ -424,11 +436,11 @@ gst_buffer_store_get_size (GstBufferStore *store, guint64 offset)
|
|||
cur_offset = 0;
|
||||
}
|
||||
while (walk) {
|
||||
current = GST_BUFFER (walk->data);
|
||||
if (have_offset && counting &&
|
||||
cur_offset + GST_BUFFER_SIZE (current) != GST_BUFFER_OFFSET (walk->data)) {
|
||||
break;
|
||||
}
|
||||
current = GST_BUFFER (walk->data);
|
||||
if (have_offset) {
|
||||
cur_offset = GST_BUFFER_OFFSET (current);
|
||||
}
|
||||
|
@ -451,5 +463,3 @@ gst_buffer_store_get_size (GstBufferStore *store, guint64 offset)
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -331,6 +331,7 @@ static void
|
|||
start_typefinding (GstTypeFindElement *typefind)
|
||||
{
|
||||
g_assert (typefind->caps == NULL);
|
||||
g_assert (typefind->possibilities == NULL);
|
||||
|
||||
GST_DEBUG_OBJECT (typefind, "starting typefinding");
|
||||
typefind->mode = MODE_TYPEFIND;
|
||||
|
|
|
@ -331,6 +331,7 @@ static void
|
|||
start_typefinding (GstTypeFindElement *typefind)
|
||||
{
|
||||
g_assert (typefind->caps == NULL);
|
||||
g_assert (typefind->possibilities == NULL);
|
||||
|
||||
GST_DEBUG_OBJECT (typefind, "starting typefinding");
|
||||
typefind->mode = MODE_TYPEFIND;
|
||||
|
|
Loading…
Reference in a new issue