decodebin3: fix segment fault when print decoder log

Segment fault happens when cannot find decoder but try to print
decoder name. Need to check the decoder.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4461>
This commit is contained in:
Hou Qi 2023-04-20 17:08:31 +08:00
parent 40bd8468af
commit aed4d31e67

View file

@ -2811,7 +2811,7 @@ reconfigure_output_stream (DecodebinOutputStream * output,
if (next_factory) {
output->decoder = gst_element_factory_create ((GstElementFactory *)
next_factory->data, NULL);
GST_DEBUG ("Created decoder '%s'", GST_ELEMENT_NAME (output->decoder));
GST_DEBUG ("Created decoder %" GST_PTR_FORMAT, output->decoder);
} else {
GST_DEBUG ("Could not find an element for caps %" GST_PTR_FORMAT,
new_caps);