Comparing a Gst_BUFFER_TIMESTAMP

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Comparing a Gst_BUFFER_TIMESTAMP

iron_guitarist1987
Hello all,

I have a pipeline with some custom plugins. When I run the pipeline, my first buffer ( in milliseconds) is negative. When I try to add the lines below, it doesn't work. For some reason, it thinks the negative number is actually positive

#define GST_TIME_MS(buf) GST_TIME_AS_MSECONDS(GST_BUFFER_TIMESTAMP(buf))

if(GST_TIME_MS(buf) < 0){
  gst_buffer_unref(buf)
  return GST_FLOW_OK;
}

The if never runs, even when the first timestamp is negative.
All your bases are belong to us.
Reply | Threaded
Open this post in threaded view
|

Re: Comparing a Gst_BUFFER_TIMESTAMP

Olivier Crête-3
Hello,

On Tue, 2012-12-25 at 23:12 -0800, iron_guitarist1987 wrote:

> Hello all,
>
> I have a pipeline with some custom plugins. When I run the pipeline, my
> first buffer ( in milliseconds) is negative. When I try to add the lines
> below, it doesn't work. For some reason, it thinks the negative number is
> actually positive
>
> #define GST_TIME_MS(buf) GST_TIME_AS_MSECONDS(GST_BUFFER_TIMESTAMP(buf))
>
> if(GST_TIME_MS(buf) < 0){
>   gst_buffer_unref(buf)
>   return GST_FLOW_OK;
> }
>
> The if never runs, even when the first timestamp is negative.

The type used for timestamps (GstClockTime) is unsigned, so it will
never be negative.


--
Olivier Crête
[hidden email]

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel