(2) evil assert in gst_segment_to_running_time

Tim-Philipp Müller t.i.m at zen.co.uk
Thu Nov 22 11:10:09 PST 2012


On Thu, 2012-11-22 at 20:59 +0200, Guetcho Guetchev wrote:

Hi,

> When I run the pipeline I get this assert:
> 
> GStreamer-CRITICAL **: guint64 gst_segment_to_running_time(const GstSegment *, GstFormat, guint64): assertion `segment->format == format' failed

It's useful to provide a stack trace with such warnings
(G_DEBUG=fatal_warnings makes glib abort, then you can get a stack trace
from gdb).


> By some reason the segment->format member is GST_FORMAT_BYTE but not GST_FORMAT_TIME
> 
> In gst_collect_pads_event_default :
> GST_EVENT_TYPE(event) is GST_EVENT_SEGMENT,
> and after gst_event_copy_segment (event, &seg);
> The seg.format is GST_FORMAT_BYTE, which means the event (a packed segment inside) has this segment type: GST_FORMAT_BYTE
> Then later in the call stack: gst_segment_to_running_time
> this is what happens: an assert statement, comparing the required format to be GST_FORMAT_TIME, but the segment.format is GST_FORMAT_UNDEFINED
> 
> My question is: is that a bug or this is caused by something I did (or I did not) do ?

Perhaps not a bug after all, though maybe it could be handled better.

Try appsrc format=time, or gst_base_src_set_format (appsrc,
GST_FORMAT_TIME).

Cheers
 -Tim



More information about the gstreamer-devel mailing list