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
This commit is contained in:
Tim-Philipp Müller 2015-08-08 15:17:54 +01:00 committed by Sebastian Dröge
parent dedb94323c
commit 8abff20185

View file

@ -535,6 +535,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);
@ -573,7 +576,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);
}