Files
FFmpeg/libavcodec
sharpbai 6966548c1b avcodec/videotoolboxenc: fix encoding frame crash on iOS 11
On iOS 11, encoding a frame may return error with log
"Error encoding frame 0", which means vtenc_output_callback
is called with status=0 and sample_buffer=NULL. Then the
encoding session will be crashed on next callback wether or not
closing the codec context.

Let us look through the link below introducing VTCompressionOutputCallback,

https://developer.apple.com/documentation/videotoolbox/vtcompressionoutputcallback?language=objc

"status=0" (noErr) means compression was successful.
"sampleBuffer=NULL" means the frame was dropped when compression
was successful (status=0) or compression was not successful (status!=0).

So we should not set AVERROR_EXTERNAL on "status=0" and "sample_buffer=NULL"
as it is not a error.

The fix is that we only set AVERROR_EXTERNAL with status value non zero.
When sample_buffer is NULL and status value is zero, we simply return
with no other operation.

This crash often occurs on iOS 11 for example encoding 720p@25fps.

Signed-off-by: sharpbai <sharpbai@gmail.com>
Signed-off-by: Rick Kern <kernrj@gmail.com>
2019-09-16 08:58:10 -04:00
..
2019-07-25 15:13:09 +01:00
2019-08-26 10:36:40 +02:00
2019-08-29 21:04:54 +02:00
2018-10-15 01:19:45 +02:00
2019-08-29 21:04:54 +02:00
2018-08-08 00:13:13 +05:30
2019-06-26 21:25:10 +02:00
2019-08-22 21:38:41 +02:00
2019-07-29 22:25:10 +01:00
2019-07-29 22:25:10 +01:00
2018-09-23 14:42:34 +01:00
2019-07-29 22:25:10 +01:00
2019-07-29 22:25:10 +01:00
2019-07-29 22:25:10 +01:00
2019-07-29 22:25:10 +01:00
2018-07-18 13:59:25 +02:00
2019-07-07 11:33:19 +02:00
2018-02-24 17:06:31 +01:00
2018-02-24 17:06:31 +01:00
2019-08-29 21:04:54 +02:00
2019-08-11 19:13:21 +02:00
2019-04-21 19:43:14 +02:00
2018-04-25 23:09:47 +02:00
2019-05-06 23:58:34 +02:00
2019-06-30 14:27:04 +02:00
2018-12-23 15:30:13 +01:00
2018-12-10 11:19:36 +01:00
2018-09-23 15:25:50 +02:00
2019-08-29 21:04:54 +02:00
2019-08-29 15:57:54 +02:00
2018-05-25 20:09:22 +02:00
2019-08-23 10:56:34 -07:00
2018-02-24 17:06:31 +01:00
2018-12-20 18:40:41 +08:00
2019-08-15 01:26:21 +02:00
2019-01-16 01:29:18 +01:00
2019-06-29 19:22:19 +02:00
2019-08-11 19:13:21 +02:00
2019-04-27 12:33:08 +02:00
2019-09-02 13:46:11 -07:00
2019-03-31 23:35:00 +02:00
2018-12-23 15:30:13 +01:00
2018-12-01 19:41:48 +01:00
2019-01-12 17:16:47 +01:00
2019-09-06 22:26:55 +02:00
2018-05-10 23:03:50 +02:00
2019-08-20 13:34:04 +08:00
2019-04-03 23:00:15 +08:00
2018-12-03 23:34:05 +01:00
2019-08-23 22:24:07 +02:00
2018-03-07 22:26:53 +01:00
2018-11-18 22:59:29 +01:00
2019-07-08 09:38:03 +02:00
2019-09-02 09:26:53 +02:00
2019-07-28 22:34:26 +01:00
2018-02-21 23:38:30 +00:00
2018-04-25 22:07:20 +02:00
2019-06-12 20:06:20 +10:00
2019-08-22 18:35:44 +02:00
2019-08-22 18:35:44 +02:00
2019-08-22 18:35:44 +02:00
2019-09-05 19:45:53 +02:00
2019-05-02 15:36:16 +02:00
2019-05-02 15:36:16 +02:00