mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
vaapidecode: fix another pad template ref leak.
This commit is contained in:
parent
d75d70d395
commit
2f127d6af4
1 changed files with 7 additions and 8 deletions
|
@ -712,6 +712,7 @@ static void
|
||||||
gst_vaapidecode_init(GstVaapiDecode *decode, GstVaapiDecodeClass *klass)
|
gst_vaapidecode_init(GstVaapiDecode *decode, GstVaapiDecodeClass *klass)
|
||||||
{
|
{
|
||||||
GstElementClass * const element_class = GST_ELEMENT_CLASS(klass);
|
GstElementClass * const element_class = GST_ELEMENT_CLASS(klass);
|
||||||
|
GstPadTemplate *pad_template;
|
||||||
|
|
||||||
decode->display = NULL;
|
decode->display = NULL;
|
||||||
decode->decoder = NULL;
|
decode->decoder = NULL;
|
||||||
|
@ -723,10 +724,9 @@ gst_vaapidecode_init(GstVaapiDecode *decode, GstVaapiDecodeClass *klass)
|
||||||
decode->is_ready = FALSE;
|
decode->is_ready = FALSE;
|
||||||
|
|
||||||
/* Pad through which data comes in to the element */
|
/* Pad through which data comes in to the element */
|
||||||
decode->sinkpad = gst_pad_new_from_template(
|
pad_template = gst_element_class_get_pad_template(element_class, "sink");
|
||||||
gst_element_class_get_pad_template(element_class, "sink"),
|
decode->sinkpad = gst_pad_new_from_template(pad_template, "sink");
|
||||||
"sink"
|
gst_object_unref(pad_template);
|
||||||
);
|
|
||||||
decode->sinkpad_caps = NULL;
|
decode->sinkpad_caps = NULL;
|
||||||
|
|
||||||
gst_pad_set_getcaps_function(decode->sinkpad, gst_vaapidecode_get_caps);
|
gst_pad_set_getcaps_function(decode->sinkpad, gst_vaapidecode_get_caps);
|
||||||
|
@ -737,10 +737,9 @@ gst_vaapidecode_init(GstVaapiDecode *decode, GstVaapiDecodeClass *klass)
|
||||||
gst_element_add_pad(GST_ELEMENT(decode), decode->sinkpad);
|
gst_element_add_pad(GST_ELEMENT(decode), decode->sinkpad);
|
||||||
|
|
||||||
/* Pad through which data goes out of the element */
|
/* Pad through which data goes out of the element */
|
||||||
decode->srcpad = gst_pad_new_from_template(
|
pad_template = gst_element_class_get_pad_template(element_class, "src");
|
||||||
gst_element_class_get_pad_template(element_class, "src"),
|
decode->srcpad = gst_pad_new_from_template(pad_template, "src");
|
||||||
"src"
|
gst_object_unref(pad_template);
|
||||||
);
|
|
||||||
decode->srcpad_caps = NULL;
|
decode->srcpad_caps = NULL;
|
||||||
|
|
||||||
gst_pad_use_fixed_caps(decode->srcpad);
|
gst_pad_use_fixed_caps(decode->srcpad);
|
||||||
|
|
Loading…
Reference in a new issue