summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libhb/sync.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libhb/sync.c b/libhb/sync.c
index b68d3ae73..66f0f56fe 100644
--- a/libhb/sync.c
+++ b/libhb/sync.c
@@ -374,9 +374,15 @@ static hb_buffer_t * CreateBlackBuf( sync_stream_t * stream,
buf = hb_frame_buffer_init(stream->common->job->pix_fmt,
stream->common->job->title->geometry.width,
stream->common->job->title->geometry.height);
- memset(buf->plane[0].data, 0x00, buf->plane[0].size);
- memset(buf->plane[1].data, 0x80, buf->plane[1].size);
- memset(buf->plane[2].data, 0x80, buf->plane[2].size);
+ uint8_t *planes[4];
+ ptrdiff_t linesizes[4];
+ for (int i = 0; i <= buf->f.max_plane; ++i)
+ {
+ planes[i] = buf->plane[i].data;
+ linesizes[i] = buf->plane[i].stride;
+ }
+ av_image_fill_black(planes, linesizes, stream->common->job->pix_fmt,
+ AVCOL_RANGE_JPEG, buf->f.width, buf->f.height);
}
else
{