GNOME Bugzilla – Bug 665205
rsndvd: sends buffers before newsegment event
Last modified: 2011-12-07 12:50:20 UTC
$ GST_DEBUG=*:2 gst-launch-0.10 rsndvdbin device=/home/tpm/Dvds/FRINGE_SEASON_1_DISC_4/ ! fakesink -v | grep fakesink fakesink0: event: type: 514, application/x-gst-dvd, event=(string)dvd-spu-reset-highlight fakesink0.GstPad:sink: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)720, height=(int)576, ... fakesink0: preroll fakesink0: event: type: 518, application/x-gst-dvd, event=(string)dvd-video-format, ... fakesink0: event: type: 518, application/x-gst-dvd, event=(string)dvd-spu-clut-change, ... fakesink0: event: type: 518, application/x-gst-dvd, event=(string)dvd-set-audio-track, ... fakesink0: chain: 622080 bytes, timestamp: 0:00:10.000000000, duration: 0:00:00.040000000, ... fakesink0: event: type: 102, GstEventNewsegment, update=(boolean)true, rate=(double)1, applied-rate=(double)1, format=(GstFormat)GST_FORMAT_TIME, start=(gint64)10505511111, stop=(gint64)-1, position=(gint64)505511111; Oh, and then it's an update=true newsegment event ? Anyway, looks wrong, doesn't happen with last release afaics.
This is caused by basetransform delaying sending of events until the caps are known. autoconvert in resindvdbin initially has an identity element, which gets the newsegment event and previously this would be pushed out of autoconvert immediately. Now this event is cached in identity and then when the caps are known in autoconvert, other elements are "linked" (autoconvert doesn't really link internally) and the old identity element never gets any caps and thus never sends any buffers. The new elements get the newsegment event but autoconvert drops them on their other side.
Not sure why this is still assigned to gst-plugins-bad when it's clearly a core bug changed by a large change to basetransform that's broken behavioural compatibility.
It's a autoconvert bug that is exposed by a bugfix in basetransform. It's was plain luck that it worked before :) And the event handling in autoconvert will break in many other cases too...
It wasn't plain luck - it was relying on behaviour of basetransform that's been there forever, and has now been replaced with something that fails to forward events that it used to send.
Only that this behaviour of basetransform was buggy and caused other problems. Synchronized events should never be sent downstream before the pad's caps are known (which is also a problem in autoconvert btw)
The relevant basetransform bug is bug #659571 , which was where the delaying of serialized events was implemented. In bug #599469 autoconvert got the initial-identity property, which was added to provide exactly the behaviour we now have a problem with: sending events (newsegment) downstream ASAP, even before any caps are known. This is not valid and setting initial-identity=false in rsndec actually makes everything work correctly again but I guess we have the problem mentioned in bug #599469 again. This should be fixed different in rsndvdbin and IMHO the initial-identity property of autoconvert should be removed again because it can't work correctly at all.
commit 780d774a5deaca6a87ab3905028fc32a1a2e0087 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Wed Dec 7 13:48:53 2011 +0100 rsndec: Don't use the initial-identity property on autoconvert It was removed, see bug #599469, #665205 commit dcf04269e1eab9d3a015218165f1027b1e4bce51 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Wed Dec 7 13:46:43 2011 +0100 autoconvert: Remove the initial-identity property from autoconvert Initially creating an identity element to forward serialized events downstream before any caps are known is broken behaviour. Serialized events should only be forwarded downstream if the caps are already known, otherwise autopluggers and other elements using pad-blocks will fail. This behaviour also doesn't work anymore after basetransform was fixed to queue serialized events until the caps are known as a result of fixing bug #659571. See bug #599469, #665205.