Commit 9bd63079 authored by Benjamin Otte's avatar Benjamin Otte
Browse files

fix issue in buffer_store_get_size spanning multiple buffers, include more...

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
parent 08337d5a
......@@ -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;
......
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