From cecb4e3af161e629ae43ad1e6c34579c0da65281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 8 Aug 2015 15:17:54 +0100 Subject: decklinkvideosrc: don't crash if we get NULL video frames in the callback For some reason we seem to sometimes get NULL video_frames in the ::VideoInputFrameArrived() callback, observed on Intensity Pro cards. https://bugzilla.gnome.org/show_bug.cgi?id=747633 --- sys/decklink/gstdecklink.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/decklink/gstdecklink.cpp b/sys/decklink/gstdecklink.cpp index eb39bdb46..8a2f10144 100644 --- a/sys/decklink/gstdecklink.cpp +++ b/sys/decklink/gstdecklink.cpp @@ -484,6 +484,9 @@ public: BMDTimeValue capture_time, capture_duration; HRESULT res; + if (video_frame == NULL) + goto no_video_frame; + res = video_frame->GetHardwareReferenceTimestamp (GST_SECOND, &capture_time, &capture_duration); @@ -522,7 +525,9 @@ public: capture_duration); } - if (got_audio_packet && audiosrc) { +no_video_frame: + + if (audio_packet && got_audio_packet && audiosrc) { m_input->got_audio_packet (audiosrc, audio_packet, capture_time); } -- cgit v1.2.1