decklink: don't crash if there are no decklink devices
Fixes generic/states check.
This commit is contained in:
parent
9bb905620c
commit
2a40ab6ad6
@ -1286,6 +1286,9 @@ gst_decklink_acquire_nth_output (gint n, GstElement * sink, gboolean is_audio)
|
|||||||
|
|
||||||
g_once (&devices_once, init_devices, NULL);
|
g_once (&devices_once, init_devices, NULL);
|
||||||
|
|
||||||
|
if (devices == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (n < 0 || (guint) n >= devices->len)
|
if (n < 0 || (guint) n >= devices->len)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -1318,6 +1321,9 @@ gst_decklink_release_nth_output (gint n, GstElement * sink, gboolean is_audio)
|
|||||||
GstDecklinkOutput *output;
|
GstDecklinkOutput *output;
|
||||||
Device *device;
|
Device *device;
|
||||||
|
|
||||||
|
if (devices == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
if (n < 0 || (guint) n >= devices->len)
|
if (n < 0 || (guint) n >= devices->len)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1346,6 +1352,9 @@ gst_decklink_acquire_nth_input (gint n, GstElement * src, gboolean is_audio)
|
|||||||
|
|
||||||
g_once (&devices_once, init_devices, NULL);
|
g_once (&devices_once, init_devices, NULL);
|
||||||
|
|
||||||
|
if (devices == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (n < 0 || (guint) n >= devices->len)
|
if (n < 0 || (guint) n >= devices->len)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -1380,6 +1389,9 @@ gst_decklink_release_nth_input (gint n, GstElement * src, gboolean is_audio)
|
|||||||
GstDecklinkInput *input;
|
GstDecklinkInput *input;
|
||||||
Device *device;
|
Device *device;
|
||||||
|
|
||||||
|
if (devices == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
if (n < 0 || (guint) n >= devices->len)
|
if (n < 0 || (guint) n >= devices->len)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user