Commit 5fdb9649 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk

ffmpeg: avfoundation patch

This patch fix large log output and slowdown for captured video
caused by calling CMSampleBufferGetImageBuffer with no video frame.
This could be fixed by bumping ffmpeg to
02f65678ba9b5958cf53d1e5bc29939d941ad95f, but it cause other
problems(crash when switching to screen sharing)

Change-Id: I0dc33683f1e40ce151130774316892f7f4730f83
parent 25e4d058
From 794bc48721d987bc9f511b89ac2353a8132f7332 Mon Sep 17 00:00:00 2001
From: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
Date: Wed, 10 Jul 2019 14:26:48 -0400
Subject: [PATCH] avfoundation_fix
---
libavdevice/avfoundation.m | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m
index 98552ac..5a3ac31 100644
--- a/libavdevice/avfoundation.m
+++ b/libavdevice/avfoundation.m
@@ -944,9 +944,8 @@ static int avf_read_packet(AVFormatContext *s, AVPacket *pkt)
CVImageBufferRef image_buffer;
lock_frames(ctx);
- image_buffer = CMSampleBufferGetImageBuffer(ctx->current_frame);
-
if (ctx->current_frame != nil) {
+ image_buffer = CMSampleBufferGetImageBuffer(ctx->current_frame);
int status;
if (av_new_packet(pkt, (int)CVPixelBufferGetDataSize(image_buffer)) < 0) {
return AVERROR(EIO);
--
2.22.0
......@@ -274,6 +274,9 @@ ffmpeg: ffmpeg-$(FFMPEG_HASH).tar.gz
(cd $@-$(FFMPEG_HASH) && tar x $(if ${BATCH_MODE},,-v) --strip-components=1 -f ../$<)
$(APPLY) $(SRC)/ffmpeg/remove-mjpeg-log.patch
$(APPLY) $(SRC)/ffmpeg/change-RTCP-ratio.patch
ifdef HAVE_MACOSX
$(APPLY) $(SRC)/ffmpeg/avfoundation_fix.patch
endif
$(UPDATE_AUTOCONFIG)
$(MOVE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment