mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-08 16:35:40 +00:00
gst/gstevent.c: copy navigation event correctly. Check freeing tag lists.
Original commit message from CVS: 2004-02-20 Benjamin Otte <otte@gnome.org> * gst/gstevent.c: (_gst_event_copy), (_gst_event_free): copy navigation event correctly. Check freeing tag lists. * gst/gstthread.c: (gst_thread_change_state): don't abort() on state changing mess - it might happen because of bugs. * gst/gstvalue.c: (gst_value_set_caps), (gst_value_get_caps): use boxed functions * gst/gstvalue.h: fix GST_VALUE_HOLDS_CAPS
This commit is contained in:
parent
fba77bb903
commit
7155cfae35
5 changed files with 30 additions and 8 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2004-02-20 Benjamin Otte <otte@gnome.org>
|
||||
|
||||
* gst/gstevent.c: (_gst_event_copy), (_gst_event_free):
|
||||
copy navigation event correctly. Check freeing tag lists.
|
||||
* gst/gstthread.c: (gst_thread_change_state):
|
||||
don't abort() on state changing mess - it might happen because of
|
||||
bugs.
|
||||
* gst/gstvalue.c: (gst_value_set_caps), (gst_value_get_caps):
|
||||
use boxed functions
|
||||
* gst/gstvalue.h:
|
||||
fix GST_VALUE_HOLDS_CAPS
|
||||
|
||||
2004-02-19 David Schleef <ds@schleef.org>
|
||||
|
||||
* gst/gstinfo.h: Copy G_STRFUNC implementation from glib-2.4
|
||||
|
|
|
@ -74,6 +74,9 @@ _gst_event_copy (GstEvent *event)
|
|||
/* FIXME copy/ref additional fields */
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_TAG:
|
||||
copy->event_data.structure.structure = gst_tag_list_copy ((GstTagList *) event->event_data.structure.structure);
|
||||
break;
|
||||
case GST_EVENT_NAVIGATION:
|
||||
copy->event_data.structure.structure = gst_structure_copy (event->event_data.structure.structure);
|
||||
default:
|
||||
break;
|
||||
|
@ -92,8 +95,12 @@ _gst_event_free (GstEvent* event)
|
|||
}
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_TAG:
|
||||
if (GST_IS_TAG_LIST (event->event_data.structure.structure))
|
||||
if (GST_IS_TAG_LIST (event->event_data.structure.structure)) {
|
||||
gst_tag_list_free (event->event_data.structure.structure);
|
||||
} else {
|
||||
g_warning ("tag event %p didn't contain a valid tag list!", event);
|
||||
GST_ERROR ("tag event %p didn't contain a valid tag list!", event);
|
||||
}
|
||||
break;
|
||||
case GST_EVENT_NAVIGATION:
|
||||
gst_structure_free (event->event_data.structure.structure);
|
||||
|
|
|
@ -476,9 +476,13 @@ gst_thread_change_state (GstElement *element)
|
|||
/* it should be dead now */
|
||||
break;
|
||||
default:
|
||||
GST_ERROR_OBJECT (element, "UNHANDLED STATE CHANGE! %x",
|
||||
GST_ERROR_OBJECT (element, "unhandled state change! %x",
|
||||
GST_STATE_TRANSITION (element));
|
||||
g_warning ("thread %s: UNHANDLED STATE CHANGE! %x",
|
||||
GST_STR_NULL (GST_OBJECT_NAME (element)), GST_STATE_TRANSITION (element));
|
||||
/* FIXME: not doable with current threading mess:
|
||||
g_assert_not_reached ();
|
||||
*/
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -682,9 +682,9 @@ gst_value_deserialize_double_range (GValue *dest, const char *s)
|
|||
void
|
||||
gst_value_set_caps (GValue *value, const GstCaps *caps)
|
||||
{
|
||||
g_return_if_fail (GST_VALUE_HOLDS_CAPS (value));
|
||||
g_return_if_fail (G_VALUE_TYPE (value) == GST_TYPE_CAPS);
|
||||
|
||||
value->data[0].v_pointer = gst_caps_copy (caps);
|
||||
g_value_set_boxed (value, caps);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -694,9 +694,9 @@ gst_value_set_caps (GValue *value, const GstCaps *caps)
|
|||
const GstCaps *
|
||||
gst_value_get_caps (const GValue *value)
|
||||
{
|
||||
g_return_val_if_fail (GST_VALUE_HOLDS_CAPS (value), 0);
|
||||
g_return_val_if_fail (G_VALUE_TYPE (value) == GST_TYPE_CAPS, NULL);
|
||||
|
||||
return value->data[0].v_pointer;
|
||||
return (GstCaps *) g_value_get_boxed (value);
|
||||
}
|
||||
|
||||
/*************************************/
|
||||
|
|
|
@ -59,7 +59,7 @@ struct _GstValueTable {
|
|||
#define GST_VALUE_HOLDS_INT_RANGE(x) (G_VALUE_HOLDS(x, gst_type_int_range))
|
||||
#define GST_VALUE_HOLDS_DOUBLE_RANGE(x) (G_VALUE_HOLDS(x, gst_type_double_range))
|
||||
#define GST_VALUE_HOLDS_LIST(x) (G_VALUE_HOLDS(x, gst_type_list))
|
||||
#define GST_VALUE_HOLDS_CAPS(x) TRUE /* FIXME */
|
||||
#define GST_VALUE_HOLDS_CAPS(x) (G_VALUE_HOLDS(x, GST_TYPE_CAPS))
|
||||
|
||||
#define GST_TYPE_FOURCC gst_type_fourcc
|
||||
#define GST_TYPE_INT_RANGE gst_type_int_range
|
||||
|
@ -102,7 +102,6 @@ double gst_value_get_double_range_min (const GValue *value);
|
|||
double gst_value_get_double_range_max (const GValue *value);
|
||||
|
||||
/* caps */
|
||||
|
||||
G_CONST_RETURN GstCaps *gst_value_get_caps (const GValue *value);
|
||||
void gst_value_set_caps (GValue *value, const GstCaps *caps);
|
||||
|
||||
|
|
Loading…
Reference in a new issue