[FFmpeg-cvslog] lavc/videotoolboxenc: skip SEI allocation when side data is not present
Aman Gupta
git at videolan.org
Wed Oct 19 04:11:43 EEST 2016
ffmpeg | branch: master | Aman Gupta <aman at tmm1.net> | Tue Oct 18 16:44:33 2016 -0700| [f45d5e07ddbdb1458cad8c42a3ed434cea5f148b] | committer: Rick Kern
lavc/videotoolboxenc: skip SEI allocation when side data is not present
Signed-off-by: Rick Kern <kernrj at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f45d5e07ddbdb1458cad8c42a3ed434cea5f148b
---
libavcodec/videotoolboxenc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index 9a69c28..cb9e2fe 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -2019,6 +2019,7 @@ static int vtenc_send_frame(AVCodecContext *avctx,
CMTime time;
CFDictionaryRef frame_dict;
CVPixelBufferRef cv_img = NULL;
+ AVFrameSideData *side_data = NULL;
ExtraSEI *sei = NULL;
int status = create_cv_pixel_buffer(avctx, frame, &cv_img);
@@ -2030,7 +2031,8 @@ static int vtenc_send_frame(AVCodecContext *avctx,
return status;
}
- if (vtctx->a53_cc) {
+ side_data = av_frame_get_side_data(frame, AV_FRAME_DATA_A53_CC);
+ if (vtctx->a53_cc && side_data && side_data->size) {
sei = av_mallocz(sizeof(*sei));
if (!sei) {
av_log(avctx, AV_LOG_ERROR, "Not enough memory for closed captions, skipping\n");
More information about the ffmpeg-cvslog
mailing list