bugfixes (don't remember them though ;)

Original commit message from CVS:
bugfixes (don't remember them though ;)
This commit is contained in:
Benjamin Otte 2003-10-27 19:01:55 +00:00
parent e167afa733
commit 23f3785d32
8 changed files with 68 additions and 38 deletions

View file

@ -131,6 +131,8 @@ gst_buffer_store_dispose (GObject *object)
static gboolean
gst_buffer_store_add_buffer_func (GstBufferStore *store, GstBuffer *buffer)
{
g_assert (buffer != NULL);
if (!GST_BUFFER_OFFSET_IS_VALID (buffer) &&
store->buffers &&
GST_BUFFER_OFFSET_IS_VALID (store->buffers->data)) {
@ -175,6 +177,7 @@ gst_buffer_store_add_buffer_func (GstBufferStore *store, GstBuffer *buffer)
if (needed_size < GST_BUFFER_SIZE (buffer)) {
/* need to create subbuffer to not have overlapping data */
GstBuffer *sub = gst_buffer_create_sub (buffer, 0, needed_size);
g_assert (sub);
buffer = sub;
} else {
gst_data_ref (GST_DATA (buffer));
@ -201,7 +204,8 @@ gst_buffer_store_add_buffer_func (GstBufferStore *store, GstBuffer *buffer)
start_offset = GST_BUFFER_OFFSET (buffer) > start_offset ? 0 :
start_offset - GST_BUFFER_OFFSET (buffer);
GstBuffer* sub = gst_buffer_create_sub (buffer, start_offset,
MIN (GST_BUFFER_SIZE (buffer), GST_BUFFER_OFFSET (current) - start_offset));
MIN (GST_BUFFER_SIZE (buffer), GST_BUFFER_OFFSET (current) - start_offset - GST_BUFFER_OFFSET (buffer)));
g_assert (sub);
buffer = sub;
} else {
gst_data_ref (GST_DATA (buffer));
@ -320,7 +324,10 @@ gst_buffer_store_get_buffer (GstBufferStore *store, guint64 offset, guint size)
cur_offset = GST_BUFFER_OFFSET (current);
}
walk = g_list_next (walk);
if (cur_offset == offset &&
if (cur_offset > offset) {
/* #include <windows.h>
do_nothing_loop (); */
} else if (cur_offset == offset &&
GST_BUFFER_SIZE (current) == size) {
GST_LOG_OBJECT (store, "found matching buffer %p for offset %"G_GUINT64_FORMAT" and size %u",
current, offset, size);

View file

@ -487,7 +487,7 @@ gst_fakesrc_set_property (GObject *object, guint prop_id, const GValue *value, G
src->pool = gst_buffer_pool_get_default (src->sizemax, 10);
} else {
if (src->pool) {
gst_buffer_pool_free (src->pool);
gst_buffer_pool_unref (src->pool);
src->pool = NULL;
}
}

View file

@ -144,6 +144,7 @@ gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability
gchar *caps_str;
g_assert (typefind->caps == NULL);
g_assert (caps != NULL);
caps_str = gst_caps_to_string (caps);
GST_INFO_OBJECT (typefind, "found caps %s", caps_str);
@ -318,8 +319,9 @@ gst_type_find_element_handle_event (GstPad *pad, GstEvent *event)
if (typefind->mode == MODE_TYPEFIND) {
/* need to do more? */
gst_data_unref (GST_DATA (event));
} else {
gst_pad_event_default (pad, event);
}
gst_pad_event_default (pad, event);
}
typedef struct {
GstTypeFindFactory * factory;
@ -603,13 +605,15 @@ gst_type_find_element_chain (GstPad *pad, GstData *data)
}
if (g_list_next (typefind->possibilities) == NULL) {
entry = (TypeFindEntry *) typefind->possibilities->data;
GST_LOG_OBJECT (typefind, "'%s' is the only typefind left, using it now (probability %u)",
GST_PLUGIN_FEATURE_NAME (entry->factory), entry->probability);
g_signal_emit (typefind, gst_type_find_element_signals[HAVE_TYPE], 0, entry->probability, entry->caps);
free_entry (entry);
g_list_free (typefind->possibilities);
typefind->possibilities = NULL;
stop_typefinding (typefind);
if (entry->probability > 0) {
GST_LOG_OBJECT (typefind, "'%s' is the only typefind left, using it now (probability %u)",
GST_PLUGIN_FEATURE_NAME (entry->factory), entry->probability);
g_signal_emit (typefind, gst_type_find_element_signals[HAVE_TYPE], 0, entry->probability, entry->caps);
free_entry (entry);
g_list_free (typefind->possibilities);
typefind->possibilities = NULL;
stop_typefinding (typefind);
}
}
}
break;

View file

@ -144,6 +144,7 @@ gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability
gchar *caps_str;
g_assert (typefind->caps == NULL);
g_assert (caps != NULL);
caps_str = gst_caps_to_string (caps);
GST_INFO_OBJECT (typefind, "found caps %s", caps_str);
@ -318,8 +319,9 @@ gst_type_find_element_handle_event (GstPad *pad, GstEvent *event)
if (typefind->mode == MODE_TYPEFIND) {
/* need to do more? */
gst_data_unref (GST_DATA (event));
} else {
gst_pad_event_default (pad, event);
}
gst_pad_event_default (pad, event);
}
typedef struct {
GstTypeFindFactory * factory;
@ -603,13 +605,15 @@ gst_type_find_element_chain (GstPad *pad, GstData *data)
}
if (g_list_next (typefind->possibilities) == NULL) {
entry = (TypeFindEntry *) typefind->possibilities->data;
GST_LOG_OBJECT (typefind, "'%s' is the only typefind left, using it now (probability %u)",
GST_PLUGIN_FEATURE_NAME (entry->factory), entry->probability);
g_signal_emit (typefind, gst_type_find_element_signals[HAVE_TYPE], 0, entry->probability, entry->caps);
free_entry (entry);
g_list_free (typefind->possibilities);
typefind->possibilities = NULL;
stop_typefinding (typefind);
if (entry->probability > 0) {
GST_LOG_OBJECT (typefind, "'%s' is the only typefind left, using it now (probability %u)",
GST_PLUGIN_FEATURE_NAME (entry->factory), entry->probability);
g_signal_emit (typefind, gst_type_find_element_signals[HAVE_TYPE], 0, entry->probability, entry->caps);
free_entry (entry);
g_list_free (typefind->possibilities);
typefind->possibilities = NULL;
stop_typefinding (typefind);
}
}
}
break;

View file

@ -131,6 +131,8 @@ gst_buffer_store_dispose (GObject *object)
static gboolean
gst_buffer_store_add_buffer_func (GstBufferStore *store, GstBuffer *buffer)
{
g_assert (buffer != NULL);
if (!GST_BUFFER_OFFSET_IS_VALID (buffer) &&
store->buffers &&
GST_BUFFER_OFFSET_IS_VALID (store->buffers->data)) {
@ -175,6 +177,7 @@ gst_buffer_store_add_buffer_func (GstBufferStore *store, GstBuffer *buffer)
if (needed_size < GST_BUFFER_SIZE (buffer)) {
/* need to create subbuffer to not have overlapping data */
GstBuffer *sub = gst_buffer_create_sub (buffer, 0, needed_size);
g_assert (sub);
buffer = sub;
} else {
gst_data_ref (GST_DATA (buffer));
@ -201,7 +204,8 @@ gst_buffer_store_add_buffer_func (GstBufferStore *store, GstBuffer *buffer)
start_offset = GST_BUFFER_OFFSET (buffer) > start_offset ? 0 :
start_offset - GST_BUFFER_OFFSET (buffer);
GstBuffer* sub = gst_buffer_create_sub (buffer, start_offset,
MIN (GST_BUFFER_SIZE (buffer), GST_BUFFER_OFFSET (current) - start_offset));
MIN (GST_BUFFER_SIZE (buffer), GST_BUFFER_OFFSET (current) - start_offset - GST_BUFFER_OFFSET (buffer)));
g_assert (sub);
buffer = sub;
} else {
gst_data_ref (GST_DATA (buffer));
@ -320,7 +324,10 @@ gst_buffer_store_get_buffer (GstBufferStore *store, guint64 offset, guint size)
cur_offset = GST_BUFFER_OFFSET (current);
}
walk = g_list_next (walk);
if (cur_offset == offset &&
if (cur_offset > offset) {
/* #include <windows.h>
do_nothing_loop (); */
} else if (cur_offset == offset &&
GST_BUFFER_SIZE (current) == size) {
GST_LOG_OBJECT (store, "found matching buffer %p for offset %"G_GUINT64_FORMAT" and size %u",
current, offset, size);

View file

@ -487,7 +487,7 @@ gst_fakesrc_set_property (GObject *object, guint prop_id, const GValue *value, G
src->pool = gst_buffer_pool_get_default (src->sizemax, 10);
} else {
if (src->pool) {
gst_buffer_pool_free (src->pool);
gst_buffer_pool_unref (src->pool);
src->pool = NULL;
}
}

View file

@ -144,6 +144,7 @@ gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability
gchar *caps_str;
g_assert (typefind->caps == NULL);
g_assert (caps != NULL);
caps_str = gst_caps_to_string (caps);
GST_INFO_OBJECT (typefind, "found caps %s", caps_str);
@ -318,8 +319,9 @@ gst_type_find_element_handle_event (GstPad *pad, GstEvent *event)
if (typefind->mode == MODE_TYPEFIND) {
/* need to do more? */
gst_data_unref (GST_DATA (event));
} else {
gst_pad_event_default (pad, event);
}
gst_pad_event_default (pad, event);
}
typedef struct {
GstTypeFindFactory * factory;
@ -603,13 +605,15 @@ gst_type_find_element_chain (GstPad *pad, GstData *data)
}
if (g_list_next (typefind->possibilities) == NULL) {
entry = (TypeFindEntry *) typefind->possibilities->data;
GST_LOG_OBJECT (typefind, "'%s' is the only typefind left, using it now (probability %u)",
GST_PLUGIN_FEATURE_NAME (entry->factory), entry->probability);
g_signal_emit (typefind, gst_type_find_element_signals[HAVE_TYPE], 0, entry->probability, entry->caps);
free_entry (entry);
g_list_free (typefind->possibilities);
typefind->possibilities = NULL;
stop_typefinding (typefind);
if (entry->probability > 0) {
GST_LOG_OBJECT (typefind, "'%s' is the only typefind left, using it now (probability %u)",
GST_PLUGIN_FEATURE_NAME (entry->factory), entry->probability);
g_signal_emit (typefind, gst_type_find_element_signals[HAVE_TYPE], 0, entry->probability, entry->caps);
free_entry (entry);
g_list_free (typefind->possibilities);
typefind->possibilities = NULL;
stop_typefinding (typefind);
}
}
}
break;

View file

@ -144,6 +144,7 @@ gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability
gchar *caps_str;
g_assert (typefind->caps == NULL);
g_assert (caps != NULL);
caps_str = gst_caps_to_string (caps);
GST_INFO_OBJECT (typefind, "found caps %s", caps_str);
@ -318,8 +319,9 @@ gst_type_find_element_handle_event (GstPad *pad, GstEvent *event)
if (typefind->mode == MODE_TYPEFIND) {
/* need to do more? */
gst_data_unref (GST_DATA (event));
} else {
gst_pad_event_default (pad, event);
}
gst_pad_event_default (pad, event);
}
typedef struct {
GstTypeFindFactory * factory;
@ -603,13 +605,15 @@ gst_type_find_element_chain (GstPad *pad, GstData *data)
}
if (g_list_next (typefind->possibilities) == NULL) {
entry = (TypeFindEntry *) typefind->possibilities->data;
GST_LOG_OBJECT (typefind, "'%s' is the only typefind left, using it now (probability %u)",
GST_PLUGIN_FEATURE_NAME (entry->factory), entry->probability);
g_signal_emit (typefind, gst_type_find_element_signals[HAVE_TYPE], 0, entry->probability, entry->caps);
free_entry (entry);
g_list_free (typefind->possibilities);
typefind->possibilities = NULL;
stop_typefinding (typefind);
if (entry->probability > 0) {
GST_LOG_OBJECT (typefind, "'%s' is the only typefind left, using it now (probability %u)",
GST_PLUGIN_FEATURE_NAME (entry->factory), entry->probability);
g_signal_emit (typefind, gst_type_find_element_signals[HAVE_TYPE], 0, entry->probability, entry->caps);
free_entry (entry);
g_list_free (typefind->possibilities);
typefind->possibilities = NULL;
stop_typefinding (typefind);
}
}
}
break;