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>
This commit is contained in:
Seungha Yang 2021-05-06 01:35:04 +09:00
parent 4c4f031207
commit 81ac09cfda

View file

@ -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,6 +1009,8 @@ public:
base_time = gst_element_get_base_time (videosrc);
got_video_frame = m_input->got_video_frame;
}
if (m_input->mode)
mode = gst_decklink_get_mode_enum_from_bmd (m_input->mode->mode);
if (m_input->audiosrc) {