Merge branch 'master' into 0.11

This commit is contained in:
Wim Taymans 2011-04-04 11:17:28 +02:00
commit 8bcaf95662
6 changed files with 54 additions and 18 deletions

View file

@ -976,25 +976,29 @@ _gst_element_request_pad (GstElement * element, GstPadTemplate * templ,
/* Can either be %s or %d or %u, do sanity checking for %d */ /* Can either be %s or %d or %u, do sanity checking for %d */
if (*(str + 1) == 'd') { if (*(str + 1) == 'd') {
gint tmp; gint64 tmp;
/* it's an int */ /* it's an int */
tmp = strtol (data, &endptr, 10); tmp = g_ascii_strtoll (data, &endptr, 10);
g_return_val_if_fail (tmp != G_MINLONG && tmp != G_MAXLONG g_return_val_if_fail (tmp >= G_MININT && tmp <= G_MAXINT
&& *endptr == '\0', NULL); && *endptr == '\0', NULL);
} else if (*(str + 1) == 'u') { } else if (*(str + 1) == 'u') {
guint tmp; guint64 tmp;
/* it's an int */ /* it's an int */
tmp = strtoul (data, &endptr, 10); tmp = g_ascii_strtoull (data, &endptr, 10);
g_return_val_if_fail (tmp != G_MAXULONG && *endptr == '\0', NULL); g_return_val_if_fail (tmp <= G_MAXUINT && *endptr == '\0', NULL);
} }
} }
pad = gst_element_get_static_pad (element, name); pad = gst_element_get_static_pad (element, name);
if (pad) if (pad) {
gst_object_unref (pad); gst_object_unref (pad);
g_return_val_if_fail (pad == NULL, NULL); /* FIXME 0.11: Change this to g_return_val_if_fail() */
g_critical ("Element %s already has a pad named %s, the behaviour of "
" gst_element_get_request_pad() for existing pads is undefined!",
GST_ELEMENT_NAME (element), name);
}
} }
#endif #endif
@ -1071,7 +1075,7 @@ gst_element_get_request_pad (GstElement * element, const gchar * name)
&& strlen (name) > str - templ->name_template) { && strlen (name) > str - templ->name_template) {
data = name + (str - templ->name_template); data = name + (str - templ->name_template);
if (*(str + 1) == 'd') { if (*(str + 1) == 'd') {
gint tmp; glong tmp;
/* it's an int */ /* it's an int */
tmp = strtol (data, &endptr, 10); tmp = strtol (data, &endptr, 10);
@ -1082,7 +1086,7 @@ gst_element_get_request_pad (GstElement * element, const gchar * name)
break; break;
} }
} else if (*(str + 1) == 'u') { } else if (*(str + 1) == 'u') {
guint tmp; gulong tmp;
/* it's an int */ /* it's an int */
tmp = strtoul (data, &endptr, 10); tmp = strtoul (data, &endptr, 10);

View file

@ -302,7 +302,11 @@ typedef enum {
* When doing fast forward (rate > 1.0) or fast reverse (rate < -1.0) trickmode * When doing fast forward (rate > 1.0) or fast reverse (rate < -1.0) trickmode
* playback, the @GST_SEEK_FLAG_SKIP flag can be used to instruct decoders * playback, the @GST_SEEK_FLAG_SKIP flag can be used to instruct decoders
* and demuxers to adjust the playback rate by skipping frames. This can improve * and demuxers to adjust the playback rate by skipping frames. This can improve
* performance and decrease CPU usage because not all frames need to be decoded. * performance and decrease CPU usage because not all frames need to be decoded.
*
* Also see part-seeking.txt in the GStreamer design documentation for more
* details on the meaning of these flags and the behaviour expected of
* elements that handle them.
*/ */
typedef enum { typedef enum {
GST_SEEK_FLAG_NONE = 0, GST_SEEK_FLAG_NONE = 0,

View file

@ -210,8 +210,11 @@ release_all_wakeup (GstPoll * set)
/* try to remove all pending control messages */ /* try to remove all pending control messages */
if (g_atomic_int_compare_and_exchange (&set->control_pending, old, 0)) { if (g_atomic_int_compare_and_exchange (&set->control_pending, old, 0)) {
/* we managed to remove all messages, read the control socket */ /* we managed to remove all messages, read the control socket */
(void) RELEASE_EVENT (set); if (RELEASE_EVENT (set))
break; break;
else
/* retry again until we read it successfully */
g_atomic_int_exchange_and_add (&set->control_pending, 1);
} }
} }
return old; return old;
@ -1375,8 +1378,13 @@ gst_poll_wait (GstPoll * set, GstClockTime timeout)
t = 0; t = 0;
} }
wait_ret = WSAWaitForMultipleEvents (set->active_events->len, if (set->active_events->len != 0) {
(HANDLE *) set->active_events->data, FALSE, t, FALSE); wait_ret = WSAWaitForMultipleEvents (set->active_events->len,
(HANDLE *) set->active_events->data, FALSE, t, FALSE);
} else {
wait_ret = WSA_WAIT_FAILED;
WSASetLastError (WSA_INVALID_PARAMETER);
}
if (ignore_count == 0 && wait_ret == WSA_WAIT_TIMEOUT) { if (ignore_count == 0 && wait_ret == WSA_WAIT_TIMEOUT) {
res = 0; res = 0;

View file

@ -782,6 +782,25 @@ gst_structure_set_field (GstStructure * structure, GstStructureField * field)
g_value_unset (&field->value); g_value_unset (&field->value);
return; return;
} }
} else if (G_UNLIKELY (GST_VALUE_HOLDS_DATE (&field->value))) {
const GDate *d;
d = gst_value_get_date (&field->value);
/* only check for NULL GDates in taglists, as they might make sense
* in other, generic structs */
if (G_UNLIKELY ((IS_TAGLIST (structure) && d == NULL))) {
GIT_G_WARNING ("Trying to set NULL GDate on field '%s' on taglist. "
"Please file a bug.", g_quark_to_string (field->name));
g_value_unset (&field->value);
return;
} else if (G_UNLIKELY (d != NULL && !g_date_valid (d))) {
g_warning
("Trying to set invalid GDate on %s field '%s'. Please file a bug.",
IS_TAGLIST (structure) ? "taglist" : "structure",
g_quark_to_string (field->name));
g_value_unset (&field->value);
return;
}
} }
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {

View file

@ -216,7 +216,7 @@ type_as_function ## _implements_interface_init (GstImplementsInterfaceClass *kla
} \ } \
\ \
static void \ static void \
type_as_function ## _init_interfaces (GType type) \ type_as_function ## _init_interfaces (GType type_var) \
{ \ { \
static const GInterfaceInfo implements_iface_info = { \ static const GInterfaceInfo implements_iface_info = { \
(GInterfaceInitFunc) type_as_function ## _implements_interface_init,\ (GInterfaceInitFunc) type_as_function ## _implements_interface_init,\
@ -229,9 +229,9 @@ type_as_function ## _init_interfaces (GType type) \
NULL, \ NULL, \
}; \ }; \
\ \
g_type_add_interface_static (type, GST_TYPE_IMPLEMENTS_INTERFACE, \ g_type_add_interface_static (type_var, GST_TYPE_IMPLEMENTS_INTERFACE, \
&implements_iface_info); \ &implements_iface_info); \
g_type_add_interface_static (type, interface_type_as_macro, \ g_type_add_interface_static (type_var, interface_type_as_macro, \
&iface_info); \ &iface_info); \
} \ } \
\ \

View file

@ -5,6 +5,7 @@ fakesink
fdsrc fdsrc
filesink filesink
filesrc filesrc
funnel
identity identity
multiqueue multiqueue
queue queue