diff options
author | Seungha Yang <seungha@centricular.com> | 2021-05-06 01:35:04 +0900 |
---|---|---|
committer | Seungha Yang <seungha@centricular.com> | 2021-05-06 01:37:33 +0900 |
commit | 81ac09cfda70c4fc5567c0549bb3123deafa341c (patch) | |
tree | a9f1b77809f457064d301952dd7c599ddc5812e1 /sys/decklink | |
parent | 4c4f03120747f3ef37dc82b79ad669eeec7d7341 (diff) | |
download | gstreamer-plugins-bad-81ac09cfda70c4fc5567c0549bb3123deafa341c.tar.gz |
decklinkvideosrc: Fix crash when mode is not specified
In that case, we will get "VideoInputFrameArrived" callback
without "VideoInputFormatChanged"
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2218>
Diffstat (limited to 'sys/decklink')
-rw-r--r-- | sys/decklink/gstdecklink.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/decklink/gstdecklink.cpp b/sys/decklink/gstdecklink.cpp index 453418059..3f79debef 100644 --- a/sys/decklink/gstdecklink.cpp +++ b/sys/decklink/gstdecklink.cpp @@ -991,7 +991,7 @@ public: GstClockTime stream_time, GstClockTime stream_duration, GstClockTime hardware_time, GstClockTime hardware_duration, gboolean no_signal) = NULL; - GstDecklinkModeEnum mode; + GstDecklinkModeEnum mode = GST_DECKLINK_MODE_AUTO; GstClockTime capture_time = GST_CLOCK_TIME_NONE; GstClockTime base_time = 0; gboolean no_signal = FALSE; @@ -1009,7 +1009,9 @@ public: base_time = gst_element_get_base_time (videosrc); got_video_frame = m_input->got_video_frame; } - mode = gst_decklink_get_mode_enum_from_bmd (m_input->mode->mode); + + if (m_input->mode) + mode = gst_decklink_get_mode_enum_from_bmd (m_input->mode->mode); if (m_input->audiosrc) { audiosrc = GST_ELEMENT_CAST (gst_object_ref (m_input->audiosrc)); |