vtenc: Error out if encoding returned an error

Otherwise we will just continue consuming frames until all memory is filled
up and the app crashes.
This commit is contained in:
Sebastian Dröge 2014-09-17 15:39:26 +03:00
parent e3bc32fb58
commit 0390398e39

View file

@ -771,6 +771,12 @@ gst_vtenc_enqueue_buffer (void *outputCallbackRefCon,
gboolean is_keyframe;
GstVideoCodecFrame *frame;
if (status != noErr) {
GST_ELEMENT_ERROR (self, LIBRARY, ENCODE, (NULL), ("Failed to encode: %d",
(int) status));
goto beach;
}
/* This may happen if we don't have enough bitrate */
if (sampleBuffer == NULL)
goto beach;