GNOME Bugzilla – Bug 688934
Gst.Event.parse_stream_start seems to not function correctly
Last modified: 2012-11-23 20:36:37 UTC
Trying to parse the stream-start to get hold of the stream id. But I am getting some weird errors.The code I have is this: def padprobe(self, pad, probeinfo, userdata): event=Gst.PadProbeInfo.get_event(probeinfo) streamid=Gst.Event.parse_stream_start(event) print(event) print(streamid) Which comes out of a : src_pad.add_probe(Gst.PadProbeType.EVENT_DOWNSTREAM, self.padprobe, "user data") However when this runs: (transmageddon.py:14655): GStreamer-CRITICAL **: gst_event_parse_stream_start: assertion `GST_EVENT_TYPE (event) == GST_EVENT_STREAM_START' failed <GstEvent at 0x7fc7b401eb00> None (transmageddon.py:14655): GStreamer-CRITICAL **: gst_event_parse_stream_start: assertion `GST_EVENT_TYPE (event) == GST_EVENT_STREAM_START' failed <GstEvent at 0x7fc7b401eb00> None <GstEvent at 0x23a1d20> 316219e736e3faa85c7d959cf09f7ba4001c84f4a39c6a5d1fd579054e7e7c32/22206b36 (transmageddon.py:14655): GStreamer-CRITICAL **: gst_event_parse_stream_start: assertion `GST_EVENT_TYPE (event) == GST_EVENT_STREAM_START' failed <GstEvent at 0x7fc7b401eb00> None *** glibc detected *** python3: double free or corruption (fasttop): 0x00007fc7ac01a920 *** -------- To me it looks like the parse_stream_start doesn't validate properly and resurns the GStreamer-CRITICAL instead of a False. Not sure what the crash at the end is about.
Perhaps after event=Gst.PadProbeInfo.get_event(probeinfo) you should first check what kind (type) of event you got, or if you got None.
Want to try checking for event type first, but the GST_EVENT_TYPE(event) doesn't seem to exist from Python.
event.type should work, we do this for GstMessage in PiTiVi.
ok, so the code is now: event=Gst.PadProbeInfo.get_event(probeinfo) eventtype=event.type if eventtype==Gst.EventType.STREAM_START: streamid=Gst.Event.parse_stream_start(event) print(event) print(streamid) But I am still getting an error: Traceback (most recent call last):
+ Trace 231218
streamid=Gst.Event.parse_stream_start(event)
return info.invoke(*args, **kwargs)
GST_DEBUG log: http://uraeus.fedorapeople.org/files/out.txt.bz2
The debug log shows the case where we get the UTF-8 error. The input file is an mp4 file with H264 and AAC audio.
ok, false positive from not returning anything from the callback. With Alessandros fix now committed I am closing this as fixed.