X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gst%2Fgstevent.c;h=0189f433b26b623d03f97ccc46282f3f69f8b745;hb=133511040930ba119ee23cea936dd6a7210f08bb;hp=cb2608872093dbb7b98f0f364a9363cf5dd6699a;hpb=9fb56a32f51cc5a624d79463ced7ccd74953e3af;p=platform%2Fupstream%2Fgstreamer.git diff --git a/gst/gstevent.c b/gst/gstevent.c index cb26088..0189f43 100644 --- a/gst/gstevent.c +++ b/gst/gstevent.c @@ -228,6 +228,9 @@ _gst_event_free (GstEvent * event) gst_structure_set_parent_refcount (s, NULL); gst_structure_free (s); } +#ifdef USE_POISONING + memset (event, 0xff, sizeof (GstEventImpl)); +#endif g_slice_free1 (sizeof (GstEventImpl), event); } @@ -448,6 +451,8 @@ void gst_event_set_seqnum (GstEvent * event, guint32 seqnum) { g_return_if_fail (GST_IS_EVENT (event)); + g_return_if_fail (seqnum != GST_SEQNUM_INVALID); + g_return_if_fail (gst_event_is_writable (event)); GST_EVENT_SEQNUM (event) = seqnum; } @@ -496,6 +501,7 @@ void gst_event_set_running_time_offset (GstEvent * event, gint64 offset) { g_return_if_fail (GST_IS_EVENT (event)); + g_return_if_fail (gst_event_is_writable (event)); ((GstEventImpl *) event)->running_time_offset = offset; } @@ -1265,6 +1271,18 @@ gst_event_new_seek (gdouble rate, GstFormat format, GstSeekFlags flags, g_return_val_if_fail (rate != 0.0, NULL); + /* SNAP flags only make sense in combination with the KEYUNIT flag. Warn + * and unset the SNAP flags if they're set without the KEYUNIT flag */ + if (!(flags & GST_SEEK_FLAG_KEY_UNIT) && + (flags & (GST_SEEK_FLAG_SNAP_BEFORE | GST_SEEK_FLAG_SNAP_AFTER | + GST_SEEK_FLAG_SNAP_NEAREST))) { + g_warning ("SNAP seeks only work in combination with the KEY_UNIT " + "flag, ignoring SNAP flags"); + flags &= + ~(GST_SEEK_FLAG_SNAP_BEFORE | GST_SEEK_FLAG_SNAP_AFTER | + GST_SEEK_FLAG_SNAP_NEAREST); + } + if (format == GST_FORMAT_TIME) { GST_CAT_INFO (GST_CAT_EVENT, "creating seek rate %lf, format TIME, flags %d, " @@ -1665,7 +1683,7 @@ gst_event_set_stream (GstEvent * event, GstStream * stream) /** * gst_event_parse_stream: * @event: a stream-start event - * @stream: (out) (transfer full): adress of variable to store the stream + * @stream: (out) (transfer full): address of variable to store the stream * * Parse a stream-start @event and extract the #GstStream from it. *