problem of function : push_sticky

Sebastian Dröge sebastian at centricular.com
Wed Nov 4 10:08:39 PST 2015


On Di, 2015-11-03 at 17:21 -0800, Majaja wrote:
> Hi all:
> 
> When trace code, I found the timing to decide whether a stick event
> will be
> pushed within push_sticky() is a little confusion for me.
> 
>   /* If we're called because of an sticky event, only forward
>    * events that would come before this new event and *the*
>    * *event itself **/
>   if (data->event && GST_EVENT_IS_STICKY (data->event) &&
>       GST_EVENT_TYPE (data->event) <= GST_EVENT_SEGMENT &&
>       GST_EVENT_TYPE (data->event) *<* GST_EVENT_TYPE (event)) {  ==>
> this
> line uses "<"??
>     data->ret = GST_FLOW_CUSTOM_SUCCESS_1;
>   } else {
>     data->ret = gst_pad_push_event_unchecked (pad, gst_event_ref
> (event),
>         GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM);
>   }
> 
> It is, the comment says "forward events come before this new event
> and the event itself ".
> But the logic shows GST_EVENT_TYPE (data->event) < GST_EVENT_TYPE
> (event) which uses "<" so I think the event itself will not be
> pushed.

The event itself is pushed in the else branch. If you check the callers
of push_sticky(), you'll see that it's a function that is called for
each sticky event.

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20151104/50accade/attachment.sig>


More information about the gstreamer-devel mailing list