Skip to content

Ensure profile thread safe

Running script like the following:

PIPELINE="filesrc location=some.avi ! avidemux ! queue ! vaapih264dec ! queue ! fakesink sync=false"
while :; do
    gst-launch-1.0 ${PIPELINE} \
                   ${PIPELINE}

    if [ $? -ne 0 ]; then echo $?; break; fi
done

I was getting errors of two types:

  1. failed delayed linking
Got context from element 'vaapidecode_h264-1': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";
Got context from element 'vaapidecode_h264-1': gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)"\(GstVaapiDisplayGLX\)\ vaapidisplayglx0";
WARNING: from element /GstPipeline:pipeline0/GstAviDemux:avidemux0: Delayed linking failed.
Additional debug info:
./grammar.y(510): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstAviDemux:avidemux0:
failed delayed linking some pad of GstAviDemux named avidemux0 to some pad of GstQueue named queue0
ERROR: from element /GstPipeline:pipeline0/GstAviDemux:avidemux0: Internal data stream error.
Additional debug info:
gstavidemux.c(5780): gst_avi_demux_loop (): /GstPipeline:pipeline0/GstAviDemux:avidemux0:
streaming stopped, reason not-linked (-1)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

and

  1. Memory corruption with backtraces like:
(gdb) bt
#0  0x00007f163874a428 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007f163874c02a in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007f163878c7ea in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3  0x00007f163879537a in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#4  0x00007f1638798350 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#5  0x00007f1638799839 in realloc () from /lib/x86_64-linux-gnu/libc.so.6
#6  0x00007f1638d4b878 in g_realloc () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#7  0x00007f1638d19399 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#8  0x00007f1638d19718 in g_array_append_vals () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9  0x00007f163646baeb in ensure_profiles (display=display@entry=0x1c779b0) at gstvaapidisplay.c:526
#10 0x00007f163646cd2e in gst_vaapi_display_get_decode_profiles (display=0x1c779b0) at gstvaapidisplay.c:1496
#11 0x00007f163643b955 in gst_vaapidecode_ensure_allowed_sinkpad_caps (decode=0x1cb95b0) at gstvaapidecode.c:1227
#12 gst_vaapidecode_sink_getcaps (vdec=0x1cb95b0, filter=0x0) at gstvaapidecode.c:1337
#13 0x00007f16369728fa in gst_video_decoder_sink_getcaps (filter=<optimized out>, decoder=0x1cb95b0) at gstvideodecoder.c:1775
#14 gst_video_decoder_sink_query_default (decoder=0x1cb95b0, query=0x7f1608006000) at gstvideodecoder.c:1824
#15 0x00007f16392dfa18 in gst_pad_query (pad=pad@entry=0x1cc4170, query=query@entry=0x7f1608006000) at gstpad.c:4071
#16 0x00007f16392dffe3 in gst_pad_peer_query (pad=pad@entry=0x1c6dd60, query=0x7f1608006000) at gstpad.c:4203
#17 0x00007f1639318258 in query_caps_func (pad=pad@entry=0x1c6dd60, data=data@entry=0x7f162641c530) at gstutils.c:2765

It was reported as issue #133 (closed)

This is fix for an issue.

Merge request reports

Loading