From 0390398e39558c703ea4180df97bfc2b3731f72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 17 Sep 2014 15:39:26 +0300 Subject: [PATCH] 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. --- sys/applemedia/vtenc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/applemedia/vtenc.c b/sys/applemedia/vtenc.c index 8465eb082f..0c02c126d2 100644 --- a/sys/applemedia/vtenc.c +++ b/sys/applemedia/vtenc.c @@ -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;