mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 07:16:55 +00:00
vdpaumpegdec: check for sink element returning wrong buffer type
This commit is contained in:
parent
325bd7aad2
commit
8ba3df0939
1 changed files with 11 additions and 2 deletions
|
@ -299,11 +299,14 @@ gst_vdp_mpeg_dec_alloc_buffer (GstVdpMpegDec * mpeg_dec, GstBuffer ** outbuf)
|
|||
{
|
||||
GstFlowReturn ret;
|
||||
|
||||
ret = gst_pad_alloc_buffer_and_set_caps (mpeg_dec->src, 0, 0,
|
||||
GST_PAD_CAPS (mpeg_dec->src), outbuf);
|
||||
ret = gst_pad_alloc_buffer (mpeg_dec->src, 0, 0, GST_PAD_CAPS (mpeg_dec->src),
|
||||
outbuf);
|
||||
if (ret != GST_FLOW_OK)
|
||||
return ret;
|
||||
|
||||
if (!GST_IS_VDP_VIDEO_BUFFER (*outbuf))
|
||||
goto wrong_buffer;
|
||||
|
||||
if (!mpeg_dec->device) {
|
||||
GstVdpDevice *device;
|
||||
VdpStatus status;
|
||||
|
@ -323,6 +326,12 @@ gst_vdp_mpeg_dec_alloc_buffer (GstVdpMpegDec * mpeg_dec, GstBuffer ** outbuf)
|
|||
}
|
||||
|
||||
return ret;
|
||||
|
||||
wrong_buffer:
|
||||
{
|
||||
gst_buffer_unref (*outbuf);
|
||||
return GST_FLOW_NOT_LINKED;
|
||||
}
|
||||
}
|
||||
|
||||
static GstFlowReturn
|
||||
|
|
Loading…
Reference in a new issue