GNOME Bugzilla – Bug 357404
[playbin] Linking can fail silently
Last modified: 2006-09-25 13:25:24 UTC
Playbin does not check if the linking to the app supplied sinks is successful. See uses of gst_element_link_pads in gst-plugins-base/gst/playback/gstplaybin.c. The problem with this is that it blindly assumes that the sink pad is named "sink". This is probably fine for the converters it creates, but not for the user-supplied sinks. I'm under the impression that element and pad names are mainly for easing debugging and documentation, they do not matter to the framework. Solution: Check link success at least with an assertion or throw an error which is even better. Link elements using gst_element_link, which does not depend on secret pad naming conventions if I'm correctly informed. Should the current naming requirement be kept, mention it in the docs. I just spent hours of wading through debug output to find out why an app would freeze over after a change so trivial I couldn't remember it or tested after including it (a simple pad name change!). That's why this bug is such a bummer, you end up with a pipeline that never gets out of preroll without any error whatsoever.
This should fix it: * gst/playback/gstplaybin.c: (gst_play_bin_class_init), (gst_play_bin_vis_blocked), (gst_play_bin_set_property), (gen_video_element), (gen_text_element), (gen_audio_element), (gen_vis_element), (remove_sinks), (add_sink), (setup_sinks), (gst_play_bin_set_clock_func), (gst_play_bin_change_state): Detect NO_PREROLL state change returns and disable clock distribution to the sinks so that sync is disabled. Avoid some type checking and do simple casts instead. Small cleanups, fix some FIXMEs. Be more robust when linking user specified elements, catch an report errors. Fixes #357404. Fix some leaks in the error paths.