mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 14:08:56 +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;
|
GstFlowReturn ret;
|
||||||
|
|
||||||
ret = gst_pad_alloc_buffer_and_set_caps (mpeg_dec->src, 0, 0,
|
ret = gst_pad_alloc_buffer (mpeg_dec->src, 0, 0, GST_PAD_CAPS (mpeg_dec->src),
|
||||||
GST_PAD_CAPS (mpeg_dec->src), outbuf);
|
outbuf);
|
||||||
if (ret != GST_FLOW_OK)
|
if (ret != GST_FLOW_OK)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
if (!GST_IS_VDP_VIDEO_BUFFER (*outbuf))
|
||||||
|
goto wrong_buffer;
|
||||||
|
|
||||||
if (!mpeg_dec->device) {
|
if (!mpeg_dec->device) {
|
||||||
GstVdpDevice *device;
|
GstVdpDevice *device;
|
||||||
VdpStatus status;
|
VdpStatus status;
|
||||||
|
@ -323,6 +326,12 @@ gst_vdp_mpeg_dec_alloc_buffer (GstVdpMpegDec * mpeg_dec, GstBuffer ** outbuf)
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
wrong_buffer:
|
||||||
|
{
|
||||||
|
gst_buffer_unref (*outbuf);
|
||||||
|
return GST_FLOW_NOT_LINKED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
|
|
Loading…
Reference in a new issue