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
2019-08-29 21:04:54 +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
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
2019-07-07 11:33:19 +02:00
2019-08-29 21:04:54 +02:00
2019-08-11 19:13:21 +02:00
2019-06-30 14:27:04 +02:00
2019-08-29 21:04:54 +02:00
2019-08-29 15:57:54 +02:00
2019-08-23 10:56:34 -07:00
2019-08-15 01:26:21 +02:00
2019-06-29 19:22:19 +02:00
2019-08-11 19:13:21 +02:00
2019-09-02 13:46:11 -07:00
2019-09-06 22:26:55 +02:00
2019-08-20 13:34:04 +08:00
2019-08-23 22:24:07 +02: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
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