vtenc: Instead of crashing if no corresponding frame is found, ignore this
authorSebastian Dröge <sebastian@centricular.com>
Mon, 22 Dec 2014 10:49:08 +0000 (11:49 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Mon, 22 Dec 2014 10:49:08 +0000 (11:49 +0100)
... and hope that everything will be fine. This shouldn't really happen but
previously happened during shutdown. It should be fixed in videoencoder now,
but better be on the safe side here.

sys/applemedia/vtenc.c

index 6d0cf345690eb322fd91efc8d477fc6b0a11ea48..70a88bc2ecdf4922341afc25eda1d75e39c98a3a 100644 (file)
@@ -1253,6 +1253,11 @@ gst_vtenc_enqueue_buffer (void *outputCallbackRefCon,
       gst_video_encoder_get_frame (GST_VIDEO_ENCODER_CAST (self),
       GPOINTER_TO_INT (sourceFrameRefCon));
 
+  if (!frame) {
+    GST_WARNING_OBJECT (self, "No corresponding frame found!");
+    goto beach;
+  }
+
   if (is_keyframe) {
     GST_VIDEO_CODEC_FRAME_SET_SYNC_POINT (frame);
     gst_vtenc_clear_cached_caps_downstream (self);